function _social_profile_get_permissions in Open Social 8.4
Same name and namespace in other branches
- 8.9 modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 8 modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 8.2 modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 8.3 modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 8.5 modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 8.6 modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 8.7 modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 8.8 modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 10.3.x modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 10.0.x modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 10.1.x modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
- 10.2.x modules/social_features/social_profile/social_profile.install \_social_profile_get_permissions()
Return the permissions per role.
Parameters
string $role: The role to get the permissions for.
Return value
array A list of permissions.
1 call to _social_profile_get_permissions()
- _social_profile_set_permissions in modules/
social_features/ social_profile/ social_profile.install - Function to set permissions.
File
- modules/
social_features/ social_profile/ social_profile.install, line 91 - Install, update and uninstall functions for the social_profile module.
Code
function _social_profile_get_permissions($role) {
// Anonymous.
$permissions['anonymous'] = [];
// Authenticated.
$permissions['authenticated'] = array_merge($permissions['anonymous'], [
'add own profile profile',
'update own profile profile',
'view any profile profile',
'view own profile profile',
'view profile',
]);
// Content manager.
$permissions['contentmanager'] = array_merge($permissions['authenticated'], [
'add any profile profile',
'update any profile profile',
'edit profile tags',
]);
// Site manager.
$permissions['sitemanager'] = array_merge($permissions['contentmanager'], [
'delete terms in profile_tag',
'edit terms in profile_tag',
'administer profile settings',
'view profile email',
]);
if (isset($permissions[$role])) {
return $permissions[$role];
}
return [];
}