function user_admin_role

7.x user_admin_role($form, $form_state, $role)

Form to configure a single role.

See also



Related topics

7 string references to 'user_admin_role'
filter_admin_format_form in drupal/modules/filter/
Form constructor for the text format add/edit form.
hook_shortcut_default_set in drupal/modules/shortcut/shortcut.api.php
Return the name of a default shortcut set for the provided user account.
standard_install in drupal/profiles/standard/standard.install
Implements hook_install().
UserPermissionsTestCase::testAdministratorRole in drupal/modules/user/user.test
Test assigning of permissions for the administrator role.
user_admin_settings in drupal/modules/user/
Form builder; Configure user settings for this site.

... See full list


drupal/modules/user/, line 951
Admin page callback file for the user module.


function user_admin_role($form, $form_state, $role) {
  if ($role->rid == DRUPAL_ANONYMOUS_RID || $role->rid == DRUPAL_AUTHENTICATED_RID) {

  // Display the edit role form.
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Role name'),
    '#default_value' => $role->name,
    '#size' => 30,
    '#required' => TRUE,
    '#maxlength' => 64,
    '#description' => t('The name for this role. Example: "moderator", "editorial board", "site architect".'),
  $form['rid'] = array(
    '#type' => 'value',
    '#value' => $role->rid,
  $form['weight'] = array(
    '#type' => 'value',
    '#value' => $role->weight,
  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save role'),
  $form['actions']['delete'] = array(
    '#type' => 'submit',
    '#value' => t('Delete role'),
    '#submit' => array('user_admin_role_delete_submit'),

  return $form;