Commit 355cc819 authored by Igor Biki's avatar Igor Biki
Browse files

Adding fix for e/c permissions, and cloing. Pushing ical install to be the last update hook.

parent 694e98d2
......@@ -714,9 +714,83 @@ function uw_sites_all_update_9112(&$sandbox) {
}
/**
* Install views ical.
* Set permissions for expand/collapse group content type.
*/
function uw_sites_all_update_9113(&$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_9114(&$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();
}
/**
* Install views ical.
*/
function uw_sites_all_update_9115(&$sandbox) {
$modules = [
'views_ical',
];
......
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