You are here

function _social_post_photo_set_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_set_permissions()
  2. 8.8 modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \_social_post_photo_set_permissions()
  3. 10.3.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \_social_post_photo_set_permissions()
  4. 10.0.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \_social_post_photo_set_permissions()
  5. 10.1.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \_social_post_photo_set_permissions()

Function to set permissions.

1 call to _social_post_photo_set_permissions()
social_post_photo_install in modules/social_features/social_post/modules/social_post_photo/social_post_photo.install
Install hook for Social Post Photo.

File

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

Code

function _social_post_photo_set_permissions() {
  $roles = \Drupal::entityQuery('user_role')
    ->condition('id', 'administrator', '<>')
    ->execute();
  foreach ($roles as $role) {
    $permissions = _social_post_photo_get_permissions($role);
    user_role_grant_permissions($role, $permissions);
  }
}