function _taxonomy_access_user_roles in Taxonomy Access Control 7
Same name and namespace in other branches
- 5.2 taxonomy_access_admin.inc \_taxonomy_access_user_roles()
- 6 taxonomy_access.module \_taxonomy_access_user_roles()
Caches a list of all roles.
@todo Replace this function once http://drupal.org/node/6463 is backported.
Parameters
string|null $permission: (optional) A string containing a permission. If set, only roles containing that permission are returned. Defaults to NULL.
Return value
array An array of roles from user_roles().
13 calls to _taxonomy_access_user_roles()
- TaxonomyAccessTestCase::checkRoleConfig in ./
taxonomy_access.test - Asserts that a status column and "Configure" link is found for the role.
- taxonomy_access_admin in ./
taxonomy_access.admin.inc - Page callback: Renders the TAC permissions administration overview page.
- 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_disable_vocab_confirm_submit in ./
taxonomy_access.admin.inc - Form submission handler for taxonomy_access_disable_vocab_confirm().
File
- ./
taxonomy_access.module, line 69 - Allows administrators to specify access control for taxonomy categories.
Code
function _taxonomy_access_user_roles($permission = NULL) {
$roles =& drupal_static(__FUNCTION__, array());
if (!isset($roles[$permission])) {
$roles[$permission] = user_roles(FALSE, $permission);
}
return $roles[$permission];
}