Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Role-based embargo exemption. #28

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rosiel
Copy link
Contributor

@rosiel rosiel commented Jan 16, 2024

Issue: #27

This lets you specify roles that are exempt from an embargo. This will help with institutional access to content where users may not be forever responsible for individual objects.

@@ -192,6 +192,10 @@ protected function buildAccessibleEmbargoesQuery($type) : SelectInterface {
$user_alias = $query->leftJoin('embargo__exempt_users', 'u', 'e.id = %alias.entity_id');
$group->condition("{$user_alias}.exempt_users_target_id", $this->user->id());

// ... the user has a role that is exempted from the embargo.
$role_alias = $query->leftJoin('embargo__exempt_roles', 'r', 'e.id = %alias.entity_id');
$group->condition("{$role_alias}.exempt_roles_target_id",$this->user->getRoles(), 'IN');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I was able to test this query section, but the rest appears to be working.

@willtp87 willtp87 added the minor Added functionality that is backwards compatible. label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Added functionality that is backwards compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants