function _social_gdpr_get_permissions in Open Social 10.3.x
Same name and namespace in other branches
- 8.9 modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 8.2 modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 8.3 modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 8.4 modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 8.5 modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 8.6 modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 8.7 modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 8.8 modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 10.0.x modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 10.1.x modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
- 10.2.x modules/custom/social_gdpr/social_gdpr.install \_social_gdpr_get_permissions()
Build the permissions.
Parameters
string $role: The role.
Return value
array Returns an array containing the permissions.
1 call to _social_gdpr_get_permissions()
- _social_gdpr_set_permissions in modules/
custom/ social_gdpr/ social_gdpr.install - Function to set permissions.
File
- modules/
custom/ social_gdpr/ social_gdpr.install, line 47 - Install, update and uninstall functions for the social_gdpr module.
Code
function _social_gdpr_get_permissions($role) {
// Anonymous.
$permissions['anonymous'] = [];
// Authenticated.
$permissions['authenticated'] = array_merge($permissions['anonymous'], []);
// Content manager.
$permissions['contentmanager'] = array_merge($permissions['authenticated'], []);
// Site manager.
$permissions['sitemanager'] = array_merge($permissions['contentmanager'], [
'administer data policy settings',
'administer data policy entities',
'edit data policy',
'view all data policy revisions',
'access data policy revisions',
'revert all data policy revisions',
'overview user consents',
'edit inform and consent setting',
'overview inform and consent settings',
'administer inform and consent settings',
'change inform and consent setting status',
'translate data_policy',
]);
if (isset($permissions[$role])) {
return $permissions[$role];
}
return [];
}