function _social_tour_set_permissions in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 8 modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 8.2 modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 8.3 modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 8.4 modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 8.5 modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 8.6 modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 8.7 modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 8.8 modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 10.3.x modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 10.0.x modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
- 10.2.x modules/custom/social_tour/social_tour.install \_social_tour_set_permissions()
Function to set permissions.
1 call to _social_tour_set_permissions()
- social_tour_install in modules/
custom/ social_tour/ social_tour.install - Implements hook_install().
File
- modules/
custom/ social_tour/ social_tour.install, line 59 - Install, update and uninstall functions for the social_tour module.
Code
function _social_tour_set_permissions() {
$roles = Role::loadMultiple();
/** @var \Drupal\user\Entity\Role $role */
foreach ($roles as $role) {
$permissions = _social_tour_get_permissions($role
->id());
if ($permissions) {
user_role_grant_permissions($role
->id(), $permissions);
}
}
}