You are here

function role_delegation_user_presave in Role Delegation 7

Same name and namespace in other branches
  1. 8 role_delegation.module \role_delegation_user_presave()

Implements hook_user_presave().

File

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

Code

function role_delegation_user_presave(&$edit, $account, $category) {
  if (isset($edit['roles_change'])) {
    $edit['roles'] = array_filter($edit['roles_change'] + $edit['roles']);
    unset($edit['roles_change']);
  }
}