function taxonomy_access_role_enabled in Taxonomy Access Control 7
Indicates whether access control is enabled for a given role.
Parameters
int $rid: The role ID.
Return value
bool TRUE if access control is enabled for the role, or FALSE otherwise.
4 calls to taxonomy_access_role_enabled()
- taxonomy_access_admin_role in ./
taxonomy_access.admin.inc - Form constructor for a form to manage grants by role.
- taxonomy_access_disable_vocab_confirm in ./
taxonomy_access.admin.inc - Returns a confirmation form for disabling a vocabulary for a role.
- taxonomy_access_enable_role in ./
taxonomy_access.module - Enables access control for a given role.
- taxonomy_access_role_delete_confirm in ./
taxonomy_access.admin.inc - Form constructor for a form to to delete access rules for a particular role.
File
- ./
taxonomy_access.module, line 434 - Allows administrators to specify access control for taxonomy categories.
Code
function taxonomy_access_role_enabled($rid) {
$role_status =& drupal_static(__FUNCTION__, array());
if (!isset($role_status[$rid])) {
$role_status[$rid] = db_query('SELECT 1
FROM {taxonomy_access_default}
WHERE rid = :rid AND vid = :vid', array(
':rid' => $rid,
':vid' => TAXONOMY_ACCESS_GLOBAL_DEFAULT,
))
->fetchField();
}
return (bool) $role_status[$rid];
}