Users, roles and permissions

One of the great features of Drupal is the ability to control how and what people can access on your site. You can set permissions for these "users" to define who can do what for Drupal core features and contributed modules. For example, you probably won't want casual visitors to edit your homepage. However, the site owner or trusted user should be able to do so. To learn more about the term "user", learn about Differentiating the Four Different Kinds of "Users" Encountered When Installing Drupal.

Drupal allows you to setup any number of different kinds of users or 'Roles'. Many websites have editor and site administrator roles; 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.

Managing roles in Drupal 5.x and 6.x

To create or edit a role, click Administration > User management > Roles.
To create or edit a user, click Administration > User management > Users.

Welcome to your new Drupal website!

This cookbook assumes you have successfully installed Drupal and are looking at a "Welcome to Drupal" screen. If you're not already to that point, the Installation Guide is for you!

The Drupal Cookbook (for beginners)

The Drupal Cookbook (for Beginners) helps Drupal "newbies" by providing a walkthrough of a common Drupal Setup.

Background

This handbook was originally written for Drupal 5. While the information is generally transferable to Drupal 6, some buttons, links, and menu items have been renamed or moved. Every attempt is made to keep these handbooks current.

The intent of the Cookbook is to help the new Drupal user create a typical site. At that point the user will be better equipped to diving deeper into more advanced features.

Service Module Example

Here is a commented example of a custom service module that uses hook_service() to become a service.

Drupal 6

Under drupal 6.x, one needs to implement hook_disable() and hook_enable() like this:

<?php
/*
* Implementation of hook_disable()
* Perform necessary actions before module is disabled. (like clear the services:methods cache)
*/
function yourModuleName_disable() {
  cache_clear_all('services:methods', 'cache');
}
/*
* Implementation of hook_enable()
* Perform necessary actions after module is enabled. (like clear the services:methods cache)
*/
function yourModuleName_enable() {
  cache_clear_all('services:methods', 'cache');
}
?>

otherwise any changes during development are unrecognised because they get cached.

Drupal 5 + 6


<?php
/*
* Implementation of hook_service()
* Required by all server modules
* Returns array defining all the methods available in the service
*/
function recipe_service_service() {
return array(

/**
* recipe.all
* We define methods in hashed arrays
*/
array(

/**
* #method - defines the namespace and method name
* the namespace is everything before the last period, so you can do
* methods like 'recipe.lunch.all' where 'recipe.lunch' is the namespace,
* or service, and 'all' is the method

Configuration of ldapdata module

This module allows mapping of LDAP user attributes to Drupal fields. It can use the profile module and/or the content profile module.

It also support letting users change their LDAP password.

To configure this module:

  • Goto Administer >> Site configuration >> LDAP >> Data

General Settings

This page displays an option to select how often user information is synchronized with LDAP and allow you to define LDAP configuration specific settings.

  • Synchronize LDAP data with Drupal profiles Select how often you want to retrieve user data from the LDAP server.
  • Server / Operations Use the edit link to create / update the LDAP Data server settings. The reset link will reset the servers settings back to the default.

LDAP Configuration Settings Page

This page lets you define how the LDAP information is mapped into Drupal user fields.

Drupal-LDAP fields mapping

This section lets you define the relationships between LDAP and Drupal information.

  • Drupal user profile field mapping: Select how you want Drupal to LDAP mapping to work.

Configuration of ldapgroups module

ldapgroups module integrates LDAP Groups with Drupal roles. In addition, it can define "access rules" that define which LDAP group members can or cannot access the site.

Please note that to configure this module, you will need to know a little bit about how groups are stored on your LDAP server. You may need to work with your LDAP/AD admin to get the information needed.

To configure the group settings:

  • Goto Administer >> Site configuration >> LDAP >> Groups

Settings Tab

This page will display a list of the configured LDAP server settings created in the LDAP Authenticate module. These can be configured with individual LDAP Groups settings to determine group and access information.

The configuration that was used to authenticate a user into Drupal will be used to perform groups and access actions.

  • Select edit to configure Groups to Roles mapping for a specific LDAP server.

Server Groups Setting Page

This page allows you to define the setting needed by the LDAP Groups module for each server.

Group Definitions

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x