function _download_count_set_permissions in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 8.2 modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 8.3 modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 8.4 modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 8.5 modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 8.6 modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 8.7 modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 8.8 modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 10.3.x modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 10.0.x modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 10.1.x modules/custom/download_count/download_count.install \_download_count_set_permissions()
- 10.2.x modules/custom/download_count/download_count.install \_download_count_set_permissions()
Function to set permissions.
1 call to _download_count_set_permissions()
- download_count_install in modules/
custom/ download_count/ download_count.install - Implements hook_install().
File
- modules/
custom/ download_count/ download_count.install, line 105 - Installation code for the download_count module.
Code
function _download_count_set_permissions() {
$roles = Role::loadMultiple();
/** @var \Drupal\user\Entity\Role $role */
foreach ($roles as $role) {
if ($role
->id() === 'administrator') {
continue;
}
$permissions = [
'view download counts',
];
user_role_grant_permissions($role
->id(), $permissions);
}
}