function _social_event_get_permissions in Open Social 8.9
Same name and namespace in other branches
- 8 modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 8.2 modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 8.3 modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 8.4 modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 8.5 modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 8.6 modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 8.7 modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 8.8 modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 10.3.x modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 10.0.x modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 10.1.x modules/social_features/social_event/social_event.install \_social_event_get_permissions()
- 10.2.x modules/social_features/social_event/social_event.install \_social_event_get_permissions()
Build permissions.
Parameters
string $role: The role.
Return value
array Returns an array containing the permissions.
1 call to _social_event_get_permissions()
- _social_event_set_permissions in modules/
social_features/ social_event/ social_event.install - Function to set permissions.
File
- modules/
social_features/ social_event/ social_event.install, line 53 - Install, update and uninstall functions for the social_event module.
Code
function _social_event_get_permissions($role) {
// Anonymous.
$permissions['anonymous'] = [
'view node.event.field_content_visibility:public content',
];
// Authenticated.
$permissions['authenticated'] = array_merge($permissions['anonymous'], [
'create event content',
'delete own event content',
'edit own event content',
'override event published option',
'view node.event.field_content_visibility:community content',
'view events on my profile',
'view events on other profiles',
]);
// Content manager.
$permissions['contentmanager'] = array_merge($permissions['authenticated'], [
'delete any event content',
'edit any event content',
'revert event revisions',
'delete event revisions',
'view event revisions',
'override event revision log entry',
'override event authored by option',
'override event authored on option',
'override event promote to front page option',
'override event revision option',
'override event sticky option',
]);
// Site manager.
$permissions['sitemanager'] = array_merge($permissions['contentmanager'], [
'administer visibility settings',
'administer social_event settings',
'view published event enrollment entities',
]);
if (isset($permissions[$role])) {
return $permissions[$role];
}
return [];
}