Some role in my site has permission to create users but not a administrator one.
How to disable create a new user of administrator role?
Is there a module for that?
thanks.
-
1I haven't used it but User protect sounds like it might do the trick– Clive ♦Commented May 17, 2012 at 18:06
-
@abd did you find solution?– UmairCommented Jan 14, 2019 at 12:16
Add a comment
|
1 Answer
You can create a module that uses a hook, something like
function remove_admin_role_choice_from_add_user_form_user_register_form_alter(&$form, &$form_state, $form_id) {
$form['account']['roles'][3]['#access'] = FALSE;
}