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()
andremove_cap()
functions. New roles can be introduced or removed using theadd_role()
andremove_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);
}
}