diff --git a/uw_cfg_common.install b/uw_cfg_common.install index 9ed2ed61a1033cab1d5f554676525f25956313a3..9c20ffa8088e3449cfe4b0df44ad4922cfcd7c53 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -8,6 +8,7 @@ use Drupal\taxonomy\Entity\Term; use Drupal\node\Entity\Node; use Drupal\uw_cfg_common\UwPermissions\UwPermissions; +use Drupal\user\Entity\Role; /** * Implements hook_install(). @@ -354,3 +355,22 @@ function uw_cfg_common_update_8101() { } } } + +/** + * Set draggable views permissions, since cd-update doesn't do it reliably. + */ +function uw_cfg_common_update_8102() { + $roles = [ + 'uw_role_content_author', + 'uw_role_content_editor', + 'uw_role_form_editor', + 'uw_role_form_results_access', + 'uw_role_site_manager', + 'uw_role_site_owner', + ]; + foreach($roles as $role_name) { + $role_object = Role::load($role_name); + $role_object->grantPermission('access draggableviews'); + $role_object->save(); + } +}