You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Add SocialUserRoleSets via Connect PHP

Question
2
Views
0
Comments
edited May 31, 2017 7:13AM in Integrations and APIs

Content

Hi,

i would like to add custom SocialUserRoleSets to a SocialUser object via connect php. The RoleSets are created in the AgentDesktop a need to be assigned to a user via Customer Portal. The Documentation of the Connect PHP API is not very clear for this functionality:

try {
    $role_set = new $cphp_SocialUserRoleSet();
    $role_set->ID = valid role ID;
    $sss_user->RoleSets[] = $role_set;
    $sss_user->save();
    }
catch (Exception $err)
    {
    // handle exceptions
    }

 

When using the code below nothing happens. Is there someone who has an idea?

Thanks!

Sascha

 

Version

Connect PHP

Code Snippet

             function addPermission($socialUser, $roleId) {
        try {
            if (empty($socialUser) || empty($roleId)) {
                \RightNow\Utils\Framework::logMessage("user or role was empty on addPermission.");
                return false;
            }

       

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!