Skip to content

Commit

Permalink
HSD8-000: Remove field_paragraph_style permissions (#1677)
Browse files Browse the repository at this point in the history
* HSD8-000: Remove field_paragraph_style permissions.
  • Loading branch information
joegl authored Nov 1, 2024
1 parent ec3b59c commit 73d032f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
1 change: 0 additions & 1 deletion config/default/user.role.anonymous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ permissions:
- 'view field_hs_accordion_views'
- 'view field_hs_text_area_bg_color'
- 'view field_media_embeddable_code'
- 'view field_paragraph_style'
- 'view humsci entity'
- 'view media'
- 'view own field_hs_accordion_views'
Expand Down
1 change: 0 additions & 1 deletion config/default/user.role.authenticated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ permissions:
- 'view field_hs_accordion_views'
- 'view field_hs_text_area_bg_color'
- 'view field_media_embeddable_code'
- 'view field_paragraph_style'
- 'view humsci entity'
- 'view media'
- 'view own field_hs_accordion_views'
Expand Down
6 changes: 0 additions & 6 deletions config/default/user.role.contributor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ dependencies:
- contextual
- dropzonejs
- entity_usage
- field_permissions
- file
- filter
- help
Expand Down Expand Up @@ -51,7 +50,6 @@ permissions:
- 'access toolbar'
- 'administer main menu items'
- 'create embeddable media'
- 'create field_paragraph_style'
- 'create file media'
- 'create hs_basic_page content'
- 'create hs_course content'
Expand Down Expand Up @@ -82,9 +80,7 @@ permissions:
- 'edit any image media'
- 'edit any video media'
- 'edit behavior plugin settings'
- 'edit field_paragraph_style'
- 'edit humsci entity'
- 'edit own field_paragraph_style'
- 'edit own file media'
- 'edit own hs_basic_page content'
- 'edit own hs_course content'
Expand Down Expand Up @@ -114,7 +110,6 @@ permissions:
- 'use text format basic_html'
- 'use text format minimal_html'
- 'use text format minimal_html_with_styles'
- 'view field_paragraph_style'
- 'view hs_basic_page revisions'
- 'view hs_course revisions'
- 'view hs_event revisions'
Expand All @@ -123,7 +118,6 @@ permissions:
- 'view hs_person revisions'
- 'view hs_publications revisions'
- 'view hs_research revisions'
- 'view own field_paragraph_style'
- 'view own unpublished content'
- 'view own unpublished media'
- 'view the administration theme'
6 changes: 0 additions & 6 deletions config/default/user.role.site_manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dependencies:
- editoria11y
- entity_usage
- entityqueue
- field_permissions
- file
- filter
- help
Expand Down Expand Up @@ -82,7 +81,6 @@ permissions:
- 'assign intranet_viewer role'
- 'assign site_manager role'
- 'create embeddable media'
- 'create field_paragraph_style'
- 'create file media'
- 'create hs_basic_block block content'
- 'create hs_basic_page content'
Expand Down Expand Up @@ -163,9 +161,7 @@ permissions:
- 'edit any image media'
- 'edit any video media'
- 'edit behavior plugin settings'
- 'edit field_paragraph_style'
- 'edit humsci entity'
- 'edit own field_paragraph_style'
- 'edit own file media'
- 'edit own hs_basic_page content'
- 'edit own hs_course content'
Expand Down Expand Up @@ -223,7 +219,6 @@ permissions:
- 'view 404 reports'
- 'view any unpublished content'
- 'view editoria11y checker'
- 'view field_paragraph_style'
- 'view hs_basic_page revisions'
- 'view hs_course revisions'
- 'view hs_event revisions'
Expand All @@ -233,7 +228,6 @@ permissions:
- 'view hs_private_page revisions'
- 'view hs_publications revisions'
- 'view hs_research revisions'
- 'view own field_paragraph_style'
- 'view own unpublished content'
- 'view own unpublished media'
- 'view restricted block content'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1000,3 +1000,29 @@ function su_humsci_profile_update_9712() {
function su_humsci_profile_update_9713() {
\Drupal::service('module_installer')->uninstall(['admin_login_path']);
}

/**
* Remove field_paragraph_style permissions.
*/
function su_humsci_profile_update_9714() {
$entity_type_manager = \Drupal::service('entity_type.manager');
$roles = $entity_type_manager->getStorage('user_role')->loadMultiple();
if (!$roles) {
return;
}

$permissions = [
'create field_paragraph_style',
'edit field_paragraph_style',
'edit own field_paragraph_style',
'view field_paragraph_style',
'view own field_paragraph_style',
];

foreach ($roles as $role) {
foreach ($permissions as $permission) {
$role->revokePermission($permission);
}
$role->save();
}
}

0 comments on commit 73d032f

Please sign in to comment.