function lightning_media_install in Lightning Media 8.4
Same name and namespace in other branches
- 8 lightning_media.install \lightning_media_install()
- 8.2 lightning_media.install \lightning_media_install()
- 8.3 lightning_media.install \lightning_media_install()
Implements hook_install().
File
- ./
lightning_media.install, line 25 - Contains install and update routines for Lightning Media.
Code
function lightning_media_install() {
// Don't do anything during config sync.
if (\Drupal::isConfigSyncing()) {
return;
}
user_role_grant_permissions('anonymous', [
'view media',
]);
user_role_grant_permissions('authenticated', [
'view media',
]);
// Grant the creator content role permission to use the rich_text format and
// the media browser.
if (\Drupal::moduleHandler()
->moduleExists('lightning_roles')) {
lightning_media_modules_installed([
'lightning_roles',
]);
}
}