You are here

function role_delegation_access in Role Delegation 7

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

Access callback for menu hook.

1 string reference to 'role_delegation_access'
role_delegation_menu in ./role_delegation.module
Implements hook_menu().

File

./role_delegation.module, line 147
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_access() {

  // Check access to user profile page.
  if (!user_access('access user profiles')) {
    return FALSE;
  }

  // Check access to role assignment page.
  if (user_access('administer permissions')) {
    return TRUE;
  }
  $perms = array_keys(role_delegation_permission());
  foreach ($perms as $perm) {
    if (user_access($perm)) {
      return TRUE;
    }
  }
  return FALSE;
}