function _social_like_set_permissions in Open Social 8.5
Same name and namespace in other branches
- 8.9 modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 8 modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 8.2 modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 8.3 modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 8.4 modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 8.6 modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 8.7 modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 8.8 modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 10.3.x modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 10.0.x modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 10.1.x modules/social_features/social_like/social_like.install \_social_like_set_permissions()
- 10.2.x modules/social_features/social_like/social_like.install \_social_like_set_permissions()
Function to set permissions.
2 calls to _social_like_set_permissions()
- social_like_install in modules/
social_features/ social_like/ social_like.install - Implements hook_install().
- social_like_update_8001 in modules/
social_features/ social_like/ social_like.install - Re-set permissions for viewing the like widget.
File
- modules/
social_features/ social_like/ social_like.install, line 66 - Install, update and uninstall functions for the social_like module.
Code
function _social_like_set_permissions() {
$roles = Role::loadMultiple();
/** @var \Drupal\user\Entity\Role $role */
foreach ($roles as $role) {
if ($role
->id() === 'administrator') {
continue;
}
$permissions = _social_like_get_permissions($role
->id());
user_role_grant_permissions($role
->id(), $permissions);
}
}