Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Multi Roles

13»

Comments

  • Is there any chance to get this into Core? Would solve a lot of problems.
  • Two pages that the multiple roles are not shown, and where it may be good to show them:

    - On the account statistics page, ie. /account.php?u=N (where N is the user ID)
    - On the user search results pages.

    I don't know if there is a delegation hook for doing that, but at the moment only the main role is displayed.
  • Hej...
    I had a little problem with the permissions and multi-roles. Somehow some granted permissions did not work for users who were not granted those permission via the mainrole but multiroles-roles.
    A little example of what I mean: User ABC has the role moderator and newsletter (=he can write a newsletter to all members). Now I have the permission PERMISSION_WRITE_NEWSLETTER and for the role newsletter it is set to true. The issue is: if the mainrole of user ABC is newsletter then the user can write a newsletter (as its supposed to), but if the mainrole is something different, for instance moderator, then suddenly the user ABC does not have that permission anymore, even though a not-mainrole should give it to him. However, the really weird thing is, that it doesn't apply to all permissions. Some work in that constellation.

    I made the following addition to the default.php of multiroles. And it seems to work... I just hope that it wont brake something at some other place. If it might does, pleas tell me.
    517,522c517 < foreach( $Permissions as $Key => $Value ) { < // added by Mumpitz because there were some weird issues with the permissions. I hope that wont brake anything < if (!array_key_exists($Key, $Context->Session->User->Permissions)) < { < $Context->Session->User->Permissions[$Key] = 0; < } --- > foreach( $Permissions as $Key => $Value ) {
    A little description of what it does: somehow the $Context->Session->User->Permissions-Array does not hold all available Permissions. But if the permission is not in that array the MultiRolesManager will not set the permission to true. Thus I check the array if the permission is in the array. If it is not inside, I'll added to the array (set to false).
  • SheilaSheila ✭✭
    Hi there! (And my first post to Vanilla forums so greetings everybody :) ) Just managed to convert my previous forum to Vanilla 1.1.8 but have issues with multiple roles. My forum relies quite heavily on them so would be appreciated to get this working. CategoryRoles 0.7 does not have any affect on the roles, just picks the primary role and it's permissions. The two patches posted on this thread just produce similar sql error as robertpate posted.
Sign In or Register to comment.