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.
Giving a user multiple roles?
Is it possible to give a user multiple roles? I couldn't seem to find a way to do this, but perhaps I've missed something.
If not, are there are add-ons available to allow this? (I searched, but couldn't find anything).
Put simply, I'd like to have one role allowed access to category A, and another allowed access to category B. I'd then like a third group of people allowed access to both categories, without having to create a third role that explicitly allows access to both (instead, those people could be members of both roles). It may not seem like much effort to create a third group, but when you multiply a similar situation out over many groups and categories, it quickly becomes a headache when users can only have one role at a time.
Thanks.
0
This discussion has been closed.
Comments
I had planned to set up a system of Vanilla boards which shared the same user base. However, with multiple roles per user I think I could achieve the same effect in one forum! Would save tonnes of work (I'd have to set up ~15 boards otherwise). Additionally, people could use the block/unblock category feature to keep track of discussions in other user groups' categories.
The only issue would be to integrate the multiple-role feature with the (coming) Attachments 2.0 extension to allow for more premissions options also there.
That being said, it's not completely out of the question to do this type of thing. You would, of course, need a junction table between roles and users. Keep in mind that the role permissions are loaded on every page load, so you'd want to spend some time altering that query to make it faster. This can be done through delegation without too much hassle. Basically you'd also need to do some work with the permission arrays - any true values override false ones.
Finally, you'd need to redo role-change form. I believe it's not included in the page until it is instantiated by the object factory, so you should be able to just write your own version and include it in the page in your extension file. That way it is already declared and the existing one won't be loaded.
Theoretically that's all you'd have to do.
One thing though: it has to be the first extension which should be loaded because the roles have to be determined before other extensions are triggered. As you can not select the order in which extensions should be loaded, you'll have to manually edit the conf/extensions.php file.
Also, I'm thinking of re-doing the roles & permissions list and sort them into different tabs or something... But maybe for a next version Once the form is done, I'll release the multi-roles extension