You are here

function _social_post_photo_get_permissions in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \_social_post_photo_get_permissions()
  2. 8.8 modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \_social_post_photo_get_permissions()
  3. 10.3.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \_social_post_photo_get_permissions()
  4. 10.0.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \_social_post_photo_get_permissions()
  5. 10.1.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \_social_post_photo_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_post_photo_get_permissions()
_social_post_photo_set_permissions in modules/social_features/social_post/modules/social_post_photo/social_post_photo.install
Function to set permissions.

File

modules/social_features/social_post/modules/social_post_photo/social_post_photo.install, line 45
The Social post photo installation.

Code

function _social_post_photo_get_permissions($role) {

  // Anonymous.
  $permissions[RoleInterface::ANONYMOUS_ID] = [];

  // Authenticated.
  $permissions[RoleInterface::AUTHENTICATED_ID] = array_merge($permissions[RoleInterface::ANONYMOUS_ID], [
    'add photo post entities',
  ]);

  // Content manager.
  $permissions['contentmanager'] = array_merge($permissions[RoleInterface::AUTHENTICATED_ID], []);

  // Site manager.
  $permissions['sitemanager'] = array_merge($permissions['contentmanager'], []);
  return $permissions[$role] ?? [];
}