Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Can I assign more than one user role (permission level) to users? WordPress

  • SOLVED

As I get deeper into my current project, I realize it is a lot more complex than I thought. In my last question I mentioned that I needed to create a bunch of unique user roles, such as:

stocking
checking
customer-service
complaints

I've been using the Capabilities Manager plugin to create the roles I need. But now I realize the number of different kinds of roles needed on this site is going to be crazy complex. I've already created over 25 roles and every time I talk to the project manager we realize we need another 5 or 10. The problem is the kinds of combinations that keep coming up. For instance:

stocking:
ability to add
ability to edit
ability to delete


checking:
ability to add
ability to edit
ability to delete


customer-service:
ability to add
ability to edit
ability to delete


complaints:
ability to add
ability to edit
ability to delete


stocking and checking:
ability to add
ability to edit
ability to delete


stocking and customer-service:
ability to add
ability to edit
ability to delete


stocking and complaints:
ability to add
ability to edit
ability to delete


stocking and checking and customer-service:
ability to add
ability to edit
ability to delete

stocking and checking and complaints:
ability to add
ability to edit
ability to delete


You get the idea? But instead of 4 base items, we've got 14. So the number of combinations is going to be in the hundreds.

So I am wondering, can I assign more than one user role to a user? Or can I create groups? I know a lot of other CMS software allows for groups and multiple roles. Joomla, for instance. Can I do anything like that with WordPress? We've already spent so much time building this site in WordPress, it is not an option to now switch to Joomla. But creating several hundred unique user roles is not appealing. Can anyone tell me how I might be able to imitate groups in WordPress?

Answers (3)

2009-12-26

Brian Richards answers:

Oh man, WP Role Scoper is the perfect plugin for you. Kevin, the author, offers a great level of support for free and can even be contracted depending on the full extent of your needs.

Check out the full rundown here: http://agapetry.net/news/introducing-role-scoper/

I've used it personally on a couple projects, most recently here: http://www.phoenixhouse.org where users were either contributors (could edit existing content but new info went into holding) or approvers (could edit and publish). We also went so far as to only allow specific groups to see specific regions. Additionally, you can apply specific priveledges to a specific user OR to a specific post/page/category for extremely fine tuning (eg an entire set of subpages could be editable by a specific group, but within that set there is one that can only be edited by a single user or users of a diff group). The best part, I think, is that users without access cannot even see the other content. To them, it doesn't exist.

2009-12-26

Brian Richards answers:

Oops, double post courtesy my phone. See above.

2009-12-27

Ron Rennick answers:

You would need to write a plugin to do it but you can assign multiple roles to a user. Which roles are assigned to a user is stored in the {table_prefix}capabilities record in the user meta table. The user capabilities are stored as an array. The values stored in the capabilities array normally correspond to permissions stored in the {table_prefix}user_roles found in the options table.