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

This discussion is related to the Multi Roles addon.
edited September 2006 in Vanilla 1.0 Help
Multi Roles


  • 1) Can anyone tell me, if this extension can solve the following problem?: In my forum, there are certain groups of users, who wish to have discussions which are 'private' to that group. That is, I should have a category, let's say, called "Group A Discussions", as well as a role which is "Group A". The idea is then, that only members of Group A will be able to see these discussions. Things start to get really tricky when people become a member of more than one group, so that they should be able to see not just the discussions for Group A, but also for Group B, etc. 2) Can anyone confirm, that this extension works nicely with Vanilla 1.1.x?
  • I'm not sure about the answers to either of your questions, one way to find out would be to try it. An alternative suggestion which may do what you want is Category Roles
  • @Minisweeper: thank you for the pointer to "Category Roles". I had a read through it, and it seems to me that with Category Roles, you can specify a MINIMUM LEVEL to work with a certain category. I do not know what 'LEVEL' means in this context. Suppose, for instance, that in my forum I have the folllowing roles: * Unauthenticated * Banned * Member * Group A * Group B * Group C * Administrator It sounds to me - perhaps wrongly - that using "Category Roles", if I set a certain category to be visible by Group C, that Group C will also view all categories visible by groups B and A (because Group C is at a 'higher level' than the others). This is not the behaviour I need. What I need is: 1) each group should be able to view ONLY its own category 2) there will be people who are members of more than 1 group, and they should be able to view all categories from all groups to which they belong. Can anyone advise me, whether "Multi Roles" or "Category Roles" will be able to do this? Any advice is greatly appreciated.
  • As far as I can tell, the Multi-Roles extension is meant to do what you're asking for, but it doesn't seem to...

    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.
  • @Eggwhite: thank you for the pointer! Yes, I see that it seems that "Multi Roles" is exactly what I need. It is indeed a great pity that it still isn't working properly. I thank you for the link (which just saved me a whole lot of time, as I was ready to try it out), and for the time being I will just sit tight - like others in the same situation - and pray for the swift return of Jazzman! :-)
  • Is the super-wonderful Jazzman still actively developing his extensions? - I sure hope so!
  • *bump* Is anyone still developing this extension? - I hope so!
  • This extension is *so* important, and unfortunately, it seems that it was last updated in September 2006. Right now, it seems to have a bug which renders it unusable in most circumstances. Browsing through the discussion pointed to by Eggwhite above, it seems that Jazzman intended to provide a fix for this bug, but has not been able to do so yet - probably busy providing support and enhancement for all his other tens of wonderful extensions. Would someone perhaps be able to help the fixing of this bug? Perhaps if some of the other good php coders here could have a look at the code, and provide Jazzman with some troubleshooting or fixing suggestions, to save him some time, we may be able to push this along!...
  • I agree, this is an important extension and it would be great it back in development.
  • May as well give my vote for getting this fixed as well - I don't have the skill to fix this, but I wish someone would!
  • Can anyone tell me, if this extension can solve the following problem:

    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
  • I'm sorry, it doesn't work with categories. You can use it to define different permissions for different roles and assign more than one role to a user, but categories wasn't possible as it's too much restricted to the Vanilla core system.
  • Try Category Roles extension?
  • It would be nice if this could extend to categories. What limitations did you find Jazzman? I will have a look see what I can make of it.

  • If you can get this to work Adam that would be great. It's the main feature that is limiting my version of the forum.

    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
    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.
  • I just wrote a big reply of my intentions, and my browser crashed, and I lost everything. Effectively, I plan on just extending Jazzman's extension to honor category permissions (and perhaps extending category permissions to provide "no access", "read", "read/write" permissions per role). I also want to add in the ability to override all set roles with one role (a role that de-merits other roles), this is a personal requirement (and an exercise that is helping to familiarise myself with Jazzman's implementation).

    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: You're on fire, this is exactly what I need! Also, if you could get it to work with your sub categories, that'd rock too.
  • Great to see this being redeveloped !!! I look forward to the next release. I desperately need this functionality so I will volunteer as a tester if you need one.
  • Hmm, I am making slow progress on this. Basically, because I cannot decide upon the best way to go about it. Effectively, it is quite simple to do... but I cannot decide on the best tact to take.

    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?

  • I personally like it when core tables are left in tact but I am not sure what the overall consensus is.
Sign In or Register to comment.