Question

I'm creating a wordpress multisite for at costumer to uses with his own customers. He need to be able to create a site when he get a new customer, and his customer should be able to control the the site.

So I want me as an superadmin, and my customer's customers to be the admin the site, so what I need is a role in between a light version of the superadmin.

I can't figure this out, i have tried different plugins fx: "User Role Editor", but no luck so fare.

Someone now how to make this work?

Était-ce utile?

La solution 2

So I finally found the solution. If installed the: "Extended Super Admins" plugin.

And then I the user the Super Admin role, and used the plugin to add a custom role based on the super admin and then it is just check the boxed of the rights he DON'T need to have.

It was really that simple!

Autres conseils

In multisite installation there already is a default admin and super-admin role, and if standard capabilities are different than what you want you can modify them:

A default set of capabilities is pre-assigned to each role, but other capabilites can be assigned or removed using the add_cap() and remove_cap() functions. New roles can be introduced or removed using the add_role() and remove_role() functions.

In this way you can customize user capabilities to your needs;


As asked from toscho I'll make an example:

you can specify new role and caps with add_role() (in ex. maior-admin)

add_action('after_setup_theme','maior_add_role_function');

function maior_add_role_function(){
$roles_set = get_option('my_roles_are_set');
if(!$roles_set){
    add_role(
'maior-admin',
'mj admin',
 array(
    'manage_sites' => true,
    'read'         => true,  
    'edit_posts'   => true,
    //set all capabilities needed - you could do this with get_role() but not so straightforward
)
);
    update_option('my_roles_are_set',true);
}
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à wordpress.stackexchange
scroll top