Saturday, December 17, 2011

51. Explain Drupal User, Permission, Role in Drupal

Every visitor to your drupal site, whether they have an account and log in or visit the site anonymously, is considered a user to Drupal. Each drupal user has a numeric user ID, and non-anonymous users also have a user name and an email address. Other information can also be associated with drupal users by modules; for instance, if you use the core Profile Drupal module, you can define user profile fields to be associated with each drupal user.

Anonymous drupal users have a user ID of zero (0). The drupal user with user ID one (1), which is the user account you create when you install Drupal, is special: that user has permission to do absolutely everything on the site.

Other users on your site can be assigned permissions via roles. To do this, you first need to create a role, which you might call "Content editor" or "Member". Next, you will assign permissions to that role, to tell Drupal what that role can and can't do on the site. Finally, you will grant certain users on your site your new role, which will mean that when those users are logged in, Drupal will let them do the actions you gave that role permission to do.

You can also assign permissions for the special built-in roles of "anonymous user" (a user who is not logged in) and "authenticated user" (a user who is logged in, with no special role assignments). Drupal permissions are quite flexible -- you are allowed to assign permission for any task to any role, depending on the needs of your site.

1 comment:

  1. what is hook complete defination of hook ?......
    my email id id shivlovevanshi@gmail.com

    ReplyDelete