Open phrichards opened 2 months ago
Sounds like we should add that line of code to the plugin?
->setRoles(explode(',', $ssoData->roles));
?
Yes, i think that would solve the issue. You may need some checking to see if the value passed in for $ssoData->roles
is a string or an array, my change here was a quick fix that worked for our use case but may not work for everyone.
Describe the bug
Hi,
We're attempting to set roles in Vanilla Forum based on a user's groups in Craft CMS. We've created a module based on the documentation at https://nystudio107.com/docs/vanillaforums/#using-vanilla-forums and are successfully setting
$event->ssoData['roles']
to our user groups, but the roles are not set in Vanilla.This is the relevant bit of the module:
In craft-vanillaforums Sso.php, we found this code that seems to be what passes the relevant data to JsConnect:
It seems like the only data passed to JsConnect is the id, name, email, and photoUrl. If I add
->setRoles(explode(',', $ssoData->roles));
the roles are set in Vanilla. Is there a setting or configuration option somewhere that I'm missing that will enable setting the roles without having to modify the plugin's code?To reproduce
Steps to reproduce the behaviour:
$ssoData
to include a['roles']
propertyExpected behaviour
The user's roles in Vanilla will match the groups they are members of in Craft.
Versions