You are here

function role_delegation_user_role_delete in Role Delegation 7

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

Implements hook_user_role_delete(). When a role is deleted, deletes the "assign role" permission for that role.

File

./role_delegation.module, line 232
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_role_delete($role) {
  db_delete('role_permission')
    ->condition('permission', "assign {$role->name} role")
    ->execute();
}