You are here

function role_delegation_user in Role Delegation 5

Same name and namespace in other branches
  1. 6 role_delegation.module \role_delegation_user()

Implementation of hook_user().

File

./role_delegation.module, line 220
This module allows site administrators to grant some roles the authority to assign selected roles to users, without them needing the 'administer access control' permission.

Code

function role_delegation_user($op, &$edit, &$account, $category = NULL) {
  if ($op != 'insert' && $op != 'submit') {
    return;
  }
  if (!isset($edit['roles_assign'])) {
    return;
  }
  $edit['roles'] = $edit['roles_preserve'] + array_filter($edit['roles_assign']);
}