Commit 65dda6a9 authored by Chris Shantz's avatar Chris Shantz
Browse files

Merge branch '1.0.x' into prod/1.0.x

parents 2c072d3d 7f22f64d
......@@ -156,8 +156,8 @@ dependencies:
- 'uw_ct_blog:uw_ct_blog'
- 'uw_ct_catalog:uw_ct_catalog'
- 'uw_ct_contact:uw_ct_contact'
- 'uw_ct_expand_collapse_group:uw_ct_expand_collapse_group'
- 'uw_ct_event:uw_ct_event'
- 'uw_ct_expand_collapse_group:uw_ct_expand_collapse_group'
- 'uw_ct_news_item:uw_ct_news_item'
- 'uw_ct_opportunities:uw_ct_opportunities'
- 'uw_ct_profile:uw_ct_profile'
......
......@@ -58,10 +58,14 @@ function uw_sites_all_install() {
])->save();
}
// Scheduler: enables "Hide seconds" option on time settings.
$scheduler_config = \Drupal::service('config.factory')->getEditable('scheduler.settings');
if ($scheduler_config) {
$scheduler_config->set('hide_seconds', TRUE)->save();
// Scheduler: enables "Hide seconds" option on time settings.
$scheduler_config->set('hide_seconds', TRUE);
// Disables log entry for lightweight cron run.
$scheduler_config->set('log', FALSE);
// Save changes.
$scheduler_config->save();
}
}
......@@ -749,3 +753,89 @@ function uw_sites_all_update_9115(&$sandbox) {
\Drupal::service('module_installer')->install($modules);
}
}
/**
* Set permissions for expand/collapse group content type.
*/
function uw_sites_all_update_9116(&$sandbox) {
// List of permissions needed to be applied to roles.
$permissions = [
'create uw_ct_expand_collapse_group content',
'edit own uw_ct_expand_collapse_group content',
'edit any uw_ct_expand_collapse_group content',
'configure editable uw_ct_expand_collapse_group node layout overrides',
'revert uw_ct_expand_collapse_group revisions',
'view uw_ct_expand_collapse_group revisions',
'enter uw_ct_expand_collapse_group revision log entry',
'override uw_ct_expand_collapse_group published option',
'override uw_ct_expand_collapse_group revision option',
'override uw_ct_expand_collapse_group sticky option',
];
$only_site_manager_permissions = [
'delete any uw_ct_expand_collapse_group content',
'delete own uw_ct_expand_collapse_group content',
];
// Roles that require updated permissions.
$role_ids = [
'uw_role_site_manager',
'uw_role_content_editor',
'uw_role_content_author',
];
$roles = Role::loadMultiple($role_ids);
// Grant all all roles.
foreach ($permissions as $permission) {
$roles['uw_role_site_manager']->grantPermission($permission);
$roles['uw_role_content_editor']->grantPermission($permission);
$roles['uw_role_content_author']->grantPermission($permission);
}
foreach ($only_site_manager_permissions as $only_site_manager_permission) {
$roles['uw_role_site_manager']->grantPermission($only_site_manager_permission);
}
// Save role with new permissions.
$roles['uw_role_site_manager']->save();
$roles['uw_role_content_editor']->save();
$roles['uw_role_content_author']->save();
}
/**
* Set permissions for expand/collapse group content type cloning.
*/
function uw_sites_all_update_9117(&$sandbox) {
// Roles that require updated permissions.
$role_ids = [
'uw_role_site_manager',
'uw_role_content_editor',
'uw_role_content_author',
];
$roles = Role::loadMultiple($role_ids);
$roles['uw_role_site_manager']->grantPermission('clone uw_ct_expand_collapse_group content');
$roles['uw_role_content_editor']->grantPermission('clone uw_ct_expand_collapse_group content');
$roles['uw_role_content_author']->grantPermission('clone uw_ct_expand_collapse_group content');
// Save role with new permissions.
$roles['uw_role_site_manager']->save();
$roles['uw_role_content_editor']->save();
$roles['uw_role_content_author']->save();
}
/**
* Disabled log entry for scheduler lightweight cron.
*/
function uw_sites_all_update_9118(array &$sandbox): void {
// Get Scheduler configuration.
$scheduler_config = \Drupal::service('config.factory')->getEditable('scheduler.settings');
if ($scheduler_config) {
// Disables lightweight cron log entry.
$scheduler_config->set('log', FALSE)->save();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment