Users, Roles and Permissions

Last modified: November 6, 2009 - 05:36

Drupal understands that different people visiting your website should have different permissions. e.g. On your website, you probably won't want casual visitors to edit your homepage. You, however, as the site owner, should be able to do so.

Drupal allows you to setup any number of different kinds of users or 'Roles'. Many websites have editors and site administrators; editors to make content updates and site admins to install new modules and make larger configuration changes.

Out of the box, Drupal recognizes two types of site visitors - those who are logged in (or 'Authenticated' users) and those who are not (or 'Anonymous' users). The exception is the first user created (user/1) -see here. Although it is not necessary, many sites have additional levels of users.

Roles are created and edited at Administration >> User management >> Roles.
Users are created and edited at Administration >> User management >> Users.
What each of those roles is allowed to do is specified via Permissions, at Administration >> User management >> Permissions

To add an additional editor to your site, you will first need to create a new role. Go to Administration >> User management >> Roles. Type in the name of your new role (e.g. 'editor') and click 'Add role'.

To add a new 'editor' user, go to Administration >> User management >> Users and click the 'Add User' tab. After typing the username and email, select the 'editor' checkbox and press 'Create new account'

Finally, you can configure permissions for editors at Administration >> User management >> Permissions. To give Editors the ability to edit any page within the site, scroll down the permissions page and click the checkbox next to 'edit any page content'.

You can configure other permissions as you desire.

User role precedence

diacono - September 23, 2009 - 19:42

I'm having some issues with permissions and was wondering if there is a specific rule regarding precedence.

For example, if authenticated users have permissions to do more than say 'sample-role'. Which one will take precedence?

Merged

NancyDru - September 23, 2009 - 23:23

Essentially all permissions are merged into what the user experiences. So if a user is logged in as "sample-role" they get everything an "authenticated user" can do PLUS whatever "sample-role" allows. So if you want some users restricted from something, "authenticated user" should be the lowest level of permissions and other roles should increase their permissions.

user id 1

ctrahey - November 6, 2009 - 05:38

Perhaps this document should include a quick reference to the special user #1, and an explanation of why/how that user is special. I think this would put the concept of "roles" in perspective, since the only user that a new reader is familiar with doesn't exactly fit in either of the two mentioned user types.

edit - modified document to mention user/1

 
 

Drupal is a registered trademark of Dries Buytaert.