You are here

function content_access_get_permission_access in Content Access 6

Same name and namespace in other branches
  1. 8 content_access.module \content_access_get_permission_access()
  2. 5 content_access.module \content_access_get_permission_access()
  3. 7 content_access.module \content_access_get_permission_access()

Returns an array of role ids, that contain the given permission.

4 calls to content_access_get_permission_access()
content_access_disable_checkboxes in ./content_access.admin.inc
Formapi #process callback, that disables checkboxes for roles without access to content
content_access_get_rids_per_node_op in ./content_access.module
Returns optimized role ids for the given operation and node to grant access for.
content_access_get_setting_defaults in ./content_access.module
Defines default values for settings.
content_access_save_permissions in ./content_access.admin.inc
Saves the given permissions by role to the database.

File

./content_access.module, line 237
Content access module file.

Code

function content_access_get_permission_access($perm, $reset = FALSE) {
  static $roles = array();
  if ($reset) {
    $roles = array();
  }
  if (!isset($roles[$perm]) && $perm) {
    $roles[$perm] = array_keys(user_roles(0, $perm));
  }
  return isset($roles[$perm]) ? $roles[$perm] : array();
}