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

implement permission check by target entity id #165

Merged
merged 1 commit into from
Nov 13, 2020

Conversation

LukasLohoff
Copy link
Member

This implements a new method

boolean hasPermission(User user, Long entityId, String targetDomainType, PermissionType permission);

in the EntityPermissionEvaluator which can be used to evaluate permissions based on the target entity id rather than providing the full entity.

Example usage:

@PreAuthorize("hasPermission(filterObjectId, 'de.terrestris.shogun.model.User', 'READ')")

@terrestris/devs Please review

Copy link
Member

@dnlkoch dnlkoch left a comment

Choose a reason for hiding this comment

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

Awesome @LukasLohoff!

@dnlkoch dnlkoch merged commit af3d371 into terrestris:master Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants