You are here

function content_access_get_permission_access in Content Access 7

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. 6 content_access.module \content_access_get_permission_access()

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

3 calls to content_access_get_permission_access()
content_access_disable_checkboxes in ./content_access.module
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.

File

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

Code

function content_access_get_permission_access($perm, $reset = FALSE) {
  $roles =& drupal_static(__FUNCTION__, 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();
}