protected function OpenAtriumAccessBaseTestCase::getPermissions in Open Atrium Core 7.2
Get all permissions defined by implementing modules.
Wraps oa_access_get_permissions(). Since we're using SimpleTestCloneTestCase, we can't guarantee that only our permissions are available, so we have to filter out all others.
Parameters
string $module: The name of the module whose permissions we want included.
boolean $reset: (Optional) If set to TRUE, it will reset the static cache.
Return value
array Associative array keyed with the permission name containing associative arrays with the following keys:
- title: Human readable name of the permission.
- description: Human readable description of the permission.
- module: The machine name of the module which defines it.
- type: Flags specifying if can be used for Groups or Teams or both.
See also
2 calls to OpenAtriumAccessBaseTestCase::getPermissions()
- OpenAtriumAccessAllTestCase::testModuleEnableAndInitialize in modules/
oa_access/ tests/ oa_access.test - OpenAtriumAccessTestCase::testGetPermissions in modules/
oa_access/ tests/ oa_access.test
File
- modules/
oa_access/ tests/ oa_access.test, line 256 - Functional tests for the Open Atrium Access module.
Class
Code
protected function getPermissions($module, $reset = FALSE) {
$permissions = array();
foreach (oa_access_get_permissions($reset) as $name => $info) {
if ($info['module'] == $module) {
$permissions[$name] = $info;
}
}
return $permissions;
}