3 Replies Latest reply on Mar 9, 2016 4:33 AM by carlesc RSS
    adityaku Apprentice

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

    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?

      • Re: How to change the mashup dynamically with the help of authenticator?
        carlesc Ninja

        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.

          • Re: How to change the mashup dynamically with the help of authenticator?
            adityaku Apprentice

            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

              • Re: How to change the mashup dynamically with the help of authenticator?
                carlesc Ninja

                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;
                                }
                            }
                        }
                    }
                }