function _social_tour_get_permissions in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 8 modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 8.2 modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 8.3 modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 8.4 modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 8.5 modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 8.6 modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 8.7 modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 10.3.x modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 10.0.x modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 10.1.x modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
- 10.2.x modules/custom/social_tour/social_tour.install \_social_tour_get_permissions()
Build permissions.
Parameters
string $role: The role.
Return value
array Returns an array.
1 call to _social_tour_get_permissions()
- _social_tour_set_permissions in modules/
custom/ social_tour/ social_tour.install - Function to set permissions.
File
- modules/
custom/ social_tour/ social_tour.install, line 81 - Install, update and uninstall functions for the social_tour module.
Code
function _social_tour_get_permissions($role) {
$permissions = [];
// Anonymous.
$permissions['anonymous'] = [];
// Authenticated.
$permissions['authenticated'] = array_merge($permissions['anonymous'], [
'access tour',
]);
// Content manager.
$permissions['contentmanager'] = array_merge($permissions['authenticated'], []);
// Site manager.
$permissions['sitemanager'] = array_merge($permissions['contentmanager'], [
'manage tour',
]);
if (isset($permissions[$role])) {
return $permissions[$role];
}
return [];
}