- Issue created by @v.koval
- πΊπ¦Ukraine v.koval
v.koval β changed the visibility of the branch feature/3484498-add-hook-to-possibility-skip-access-before-sending-email to hidden.
- πΊπ¦Ukraine v.koval
Sometimes we need to send a notification about an entity to a user who does not have access for that entity
For example, we want to notify a user that their request to join a group
has been rejected. Here, the related entity is group_membership_request
, however, the user does not have access to view
operation in this case.
Initialize an array for message bundles for which related entity access
checks will be skipped, and give possibility to alter this array using a hook
$message_template_bundles = [];
$this->moduleHandler->alter('activity_send_email_template_access', $message_template_bundles);
// Only for users that have access to related content,
// if it's not a specific message template.
if (in_array($parameters['message']->bundle(), $message_template_bundles) || $parameters['activity']->getRelatedEntity()->access('view', $target_account)) {
?>
?>
Needs work
13.0
Code (back-end)
v.koval β changed the visibility of the branch feature/3484498-add-hook-to-possibility-skip-access-before-sending-email to hidden.