Skip to content

Commit

Permalink
feat(shs-5180): update postcard media link permissions with update hook
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorlj committed Jan 3, 2024
1 parent 2361a36 commit 6f07422
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/default/user.role.anonymous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- eck
- field_permissions
- media
- media_entity_download
- system
_core:
default_config_hash: j5zLMOdJBqC0bMvSdth5UebkprJB8g_2FXHqhfpJzow
Expand All @@ -15,6 +16,7 @@ weight: -1
is_admin: false
permissions:
- 'access content'
- 'download media'
- 'view any course_collections entities'
- 'view any event_collections entities'
- 'view any publications_collections entities'
Expand Down
2 changes: 2 additions & 0 deletions config/default/user.role.authenticated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
- filter
- fontawesome
- media
- media_entity_download
- shortcut
- system
_core:
Expand All @@ -25,6 +26,7 @@ permissions:
- 'access fontawesome additional settings'
- 'access shortcuts'
- 'delete own files'
- 'download media'
- 'use text format basic_html_without_media'
- 'use text format webform_default'
- 'view any course_collections entities'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* hs_postcard.install
*/

use Drupal\user\UserInterface;

/**
* Implements hook_install().
*/
Expand All @@ -21,3 +23,12 @@ function hs_postcard_install() {
}

}

/**
* Set the permissions for the postcard download links.
*/
function hs_postcard_update_10000() {
$perms = ['download media'];
user_role_grant_permissions(UserInterface::ANONYMOUS_ROLE, $perms);
user_role_grant_permissions(UserInterface::AUTHENTICATED_ROLE, $perms);
}

0 comments on commit 6f07422

Please sign in to comment.