Skip to main content
March 9, 2016
Question

How to change the mashup dynamically with the help of authenticator?

  • March 9, 2016
  • 1 reply
  • 1944 views

We have a condition that some group name can see one mashup and another group name can see another mashup. How to do it. We have to change the mashup and widgets dynamically on the basis of group name?

1 reply

1-Visitor
March 9, 2016

Hi,

I don't know  if with an Authenticator can be done, but easily you can build a script that sets user Home Mashup depending on the group it belongs to.

Carles.

March 9, 2016

Hi,

Thanks Carles for the response. Do you have any example for setting it ? If you have then can you please share with me.

Thanks,

Aditya Kumar

1-Visitor
March 9, 2016

Hi Aditya,

Should be something like this ( take it easy, I didn't tested it 😞

var searchResult = Resources["SearchFunctions"].SearchPeople({

  maxItems: 1000000 ,

  searchExpression: undefined ,

    modelTags: undefined,

  query: undefined,

  aspects: undefined,

  excludedAspects: undefined,

    maxSearchItems: undefined

});

if (searchResult.rows.length) {

   var peopleNames = searchResult.rows[0].peopleResults;

   var user,userGroups,group,groupHomeMashup;

   for each(peopleRow in peopleNames.rows) {

        user = Users[peopleRow.name];

        userGroups = user.GetGroups();

        for each(groupRow in userGroups.rows) {

            group = Groups[groupRow.name];

            if (group) {

                groupHomeMashup = group.GetHomeMashup();

                if (groupHomeMashup) {

                    user.SetHomeMashup({ name: groupHomeMashup });

                    break;

                }

            }

        }

    }

}