function hook_oa_access_permission in Open Atrium Core 7.2
Define an Open Atrium permission that can be assigned to a Group or Team.
This hook can supply permissions that the module defines, so that they can be selected on the admin page and used to grant or restrict access to certain actions the module performs.
Return value
array An associative array whose keys are permission names and values are associative arrays containing the following keys:
- title: Human readable name of the permission.
- description: (Optional) Human readable description of the permission.
- type: (Optional) Flag specifying if it can be assigned to Groups or
Teams or both. By default, it allows both.
- OA_ACCESS_DEFAULT_PERMISSION: (default) Allows this permission on both Groups on Teams.
- OA_ACCESS_GROUP_PERMISSION: Only allowed on Groups.
- OA_ACCESS_TEAM_PERMISSION: Only allowed on Teams.
- OA_ACCESS_ALLOW_OPTION_ALL: Allows an 'All site users' or 'All Space members' option on this permission.
- OA_ACCESS_DEFAULT_OPTION_ALL: Defaults this permission to the 'All' option. This will be setup for all permissions declared by your module when installed, but if you add any new permissions later, you'll need to manually call oa_access_initialize_permissions().
The flags can be combined if you'd like to be explicit, for example:
'type' => OA_ACCESS_GROUP_PERMISSION | OA_ACCESS_TEAM_PERMISSION,
See also
hook_oa_access_permission_alter()
oa_access_initialize_permissions()
Related topics
2 functions implement hook_oa_access_permission()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- oa_access_test_all_oa_access_permission in modules/
oa_access/ tests/ oa_access_test_all/ oa_access_test_all.module - Implements hook_oa_access_permission().
- oa_access_test_oa_access_permission in modules/
oa_access/ tests/ oa_access_test/ oa_access_test.module - Implements hook_oa_access_permission().
1 invocation of hook_oa_access_permission()
- oa_access_get_permissions in modules/
oa_access/ oa_access.module - Get all permissions defined by implementing modules.
File
- modules/
oa_access/ oa_access.api.php, line 46 - Contains documentation about the Open Atrium Access module's hooks.
Code
function hook_oa_access_permission() {
return array(
'do something awesome' => array(
'title' => t('Do something awesome'),
'description' => t('Be careful who give this permission to, because soon everyone might want it!'),
),
);
}