JohnS
Veteran
Just Getting Started
Member Likes (0)
Does anyone know if there is a plugin or script that I can use to create a new user role with custom capabilities that works with Wordpress Multisite? My goal is to restrict creation of new communities via the Communities plugin to a select group of admins. Originally I thought I would try creating a custom user role similar to administrator but with an extra user capability and then test for it using something similar to if ( current_user_can( $capability ) ) { } to show/hide the create communities options if applicable. Those I wish to create communities could then be upgraded to the new user role.
Problem is that every plugin I've tried at this point only adds roles and capabilities to my site and won't allow me to upgrade users in their own sites. Any Ideas? Is there an easier way to do this that I don't know about? (Sorry, but I'm new to multisite)
Thanks for the help!

Responses (4)
Member (joined April 2009) Likes (0)
Hiya John,
First off, welcome to WPMU DEV! :D
This isn't the easiest thing to do by default with WordPress unfortunately - at least not by defining user roles. Here's a couple options to try:
http://wordpress.org/extend/plugins/adminimize/
Custom options instructions:
http://wordpress.org/support/topic/plugin-adminimize-help-with-your-own-options
Other Role Management plugin for WordPress Multi-site:
http://www.shinephp.com/user-role-editor-wordpress-plugin/
http://www.shinephp.com/how-to-change-wordpress-mu-user-role-capabilities/
You could, alternatively, use something like our Supporter or 'Upgrades' plugin to charge for access to this plugin (or manually activate them if there's only a few).
Hope some of this info helps. Anyone else have a suggestion for John?
Let us know how you to decide to proceed.
Member (joined November 2010) Likes (0)
Thanks for the response Masonjames!
Unfortunately having a paid option won't work because I'm only disabling access to one feature of the plugin and I also want it limited to hand picked individuals (not anyone with money). I checked the user role editor plugin and noticed that the author has said that a "Network feature, something like super-admin global role editor will be added in the nearest release." So I will keep my eye out for that! In the mean time, I thought about dumping the following into the mu-plugins directory.
<?phpglobal $current_user;
if( $current_user->id == 'x' ) {
$edit_administrator->add_cap('create_communities');
}
//etc...
?>
LOL not sure if that code is correct. However I'm afraid that if I use it, as soon as user x logs on the cap will be added into the database and any administrator will have access... (Or is this not a problem because there is only 1 admin per site?) Any thoughts? Thanks again for letting me know about the plugin! It will be perfect when it comes out.
Member (joined February 2011) Likes (0)
Hi JohnS
I'm not sure if this plugin will help you. I'm new to WPMUDEV and haven't tried the communities plugin yet, but this is one of the most flexible of all plugins I've tried that deals with customizing and fine tuning permissions for members.
http://justintadlock.com/archives/2009/09/17/members-wordpress-plugin
Donna
Support Kangaroo (joined March 2011) Likes (0)
Greetings :-)
@masonjames
sir in your kind message and attempt to help John you said:
"You could, alternatively, use something like our Supporter or 'Upgrades' plugin to charge for access to this plugin (or manually activate them if there's only a few)."
All due respect but I believe you to be mistaken since it does NOT show to be controlled or appear in supporter nor plugin management - installs in the Must Use directory as instructions dictate and therefore is not subject to control via these aforementioned ways.
Joe :-)
PS: I would happily like to know that I am wrong so that I may activate it only for paid members :-) but do not see any stock way of doing so.
Become a member