2

I want to create a role in Drupal. I want create role assign to specific user. Specific user can create only user and not anything.

  • do you have some advance? If one of the answers help you remember check it as accepted, if you don't know how, you can read this drupal.stackexchange.com/tour – Adrian Cid Almaguer Apr 13 '16 at 15:52
  • Hi @maheshsingh , I just quickly checked the various questions you asked. I (and Adrian?) realise you're fairly new here, and I (we) know that it can be hard for a new user to learn some of the basics rules of this site. You have quite a few questions with negative votes, are you interested in some suggestions (via extra comments) to improve those questions (and learn from mistakes)? Also, is there really not 1 of both answers here you want to mark "accepted"? You'll gain +2 points for it! Also, don't forget to provide feedback on my answer to your other question. Just trying to help, OK? – Pierre.Vriens Apr 14 '16 at 16:08
  • do you solve your problem? – Adrian Cid Almaguer Apr 21 '16 at 1:47
  • function contentalter_form_alter(&$form, &$form_state, $form_id) { //Check with your form_id if ($form_id == 'model-node-form') { unset($form['author']);//remove authoring unset($form['menu']);//remove menu options unset($form['options']);//remove publishing options unset($form['comment_settings']);//remove comment settings unset($form['path']);//remove url path settings (if path module is enabled) unset($form['log']);//log box unset($form['body_filter']['filter']);//remove input format } } – maheshsingh Apr 21 '16 at 6:47
3

Go to admin/people/permissions/roles and create your role. Then go to admin/people/permissions and uncheck all the permission for the new user and check the Administer users permission in the User section:

enter image description here

To uncheck all the permission I can sugest you the use of the Permission Select module.

Permission Select is a module that allows for quicker editing of role permissions on /admin/user/permissions.

And as Pierre Vriens says in his comment:

"do not grant ANY permissions to authenticated users". Because any user with permission to create users is also an authenticated user.

  • 1
    Shouldn't this be combined with "do not grant ANY permissions to authenticated users"? Because any user with permission to create users is also an authenticated user. Get my point? – Pierre.Vriens Apr 10 '16 at 6:40
  • 1
    @pierre.vriens Yes this is a good idea, I will do this from my laptop because I now in the phone. – Adrian Cid Almaguer Apr 10 '16 at 14:03
  • 1
    Wanna help "teaching" a new user a bit (like I did with my comment below the question here)? – Pierre.Vriens Apr 14 '16 at 16:09
2

You can create roles in drupal 7 on admin/people/permissions/roles. Then assign the permissions that you want to that role.

There is a permission called "Administer users" but be careful because it can have security implications. Make sure that it only does what the user is supposed to do: test it!

Otherwise you could create your own permission with hook_permission and decide exactly what permission you want to grant.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.