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

SEC-2852: Possibility to impersonate a Principal when using annotation hasPermission #3074

Open
spring-projects-issues opened this issue Feb 17, 2015 · 0 comments
Labels
in: acl An issue in spring-security-acl in: core An issue in spring-security-core type: enhancement A general enhancement type: jira An issue that was migrated from JIRA

Comments

@spring-projects-issues
Copy link

Oliver Fernandez (Migrated from SEC-2852) said:

It would be very useful to be able to impersonate another principal when using the annotation hasPermission

The current interface SecurityExpressionOperations only declares the following method

boolean hasPermission(Object target, Object permission)

I propose to also declare:

boolean hasPermission(UserDetails principal, Object target, Object permission)

A very typical use case is that an administrator wants to list the entities a given user has permissions to read, and then manage those permissions.

In the following gist there is a possible implementation of this method:

https://gist.github.com/oliverfernandez/c56f833d058fcae53a1b

@spring-projects-issues spring-projects-issues added in: acl An issue in spring-security-acl in: core An issue in spring-security-core Open type: enhancement A general enhancement type: jira An issue that was migrated from JIRA labels Feb 5, 2016
@rwinch rwinch removed the Open label May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: acl An issue in spring-security-acl in: core An issue in spring-security-core type: enhancement A general enhancement type: jira An issue that was migrated from JIRA
Projects
None yet
Development

No branches or pull requests

2 participants