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
Multi Roles
0
Comments
Here's a thread which discusses the problem a bit more. I'd guess it's probably better to use this one, though, as it's tied to the add-on itself.
Can I assigned 2 roles to an user. The user must be an administrator for one category and member for others.
I have created a new admin role for The category, I have added roles abilities (edit/delete comments + discussion) and select the good category.
After I was assigned the new role to the user (the main role is "member" and i added a second role "admin2".)
But the role “admin2†is applied has all the categories and the user can edit/delete all comments and discussions in all categories!!!
Normally he just can modified the only category was I selected!!!
Can anyone confirm, that this extension works nicely?
So I use vanilla 1.1.2
Adam.
I was thinking about this a while back, and thought the below idea for structure would work and would be simple.
(NOTE: I say that being a novice coder and not having actually looked into it. This would likely be for a fresh extension since I think this uses existing tables.)
Create a new table in the database called multi_roles. Have a stucture of
ID | UserID | Role ID |
--------------------------------
You would then assign the person a main role and have the option to add addition roles (similar to the interface used here)
Then (and this is the part that may not be simple) change the way vanilla looks at the role for access.
I assume now it checks for the user's role in the main table, then gives access. It would need to be changed to check user's role as it does now and then check for user role in the multi_roles table .
I need it set so that I have master and sub roles so that may explain my logic
ie:
Role 1
-Sub role 1
-Sub role 2
Role 2
-Sub role 1
-Sub role 2
-Sub role 3
I have several users and some would have multiple sub roles under a roll.
If this doesn't make sense or is just not doable please let me know.
What you describe is kinda how Jazzman's extension currently works, you can assign a user a master role, and then secondary roles - the user then picks up the most advantageous permissions of the roles. I have no intention of changing this functionality.
Adam.
I wanted to ask, whether extensions altering the structure of the database is frowned upon as I wanted to add a new column to the CategoryRoleBlock table which will hold the read/write permission of the category. It will be called ReadOnly and will be of type enum('1','0') (1 for read only, 0 to maintain read/write access), would this sort of modification being made by an extension be acceptable?
Adam.