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

Management API: Allow Authorization override for "admin" #247

Closed
paullatzelsperger opened this issue Jan 30, 2024 · 0 comments · Fixed by #255
Closed

Management API: Allow Authorization override for "admin" #247

paullatzelsperger opened this issue Jan 30, 2024 · 0 comments · Fixed by #255
Assignees
Labels
api enhancement New feature or request

Comments

@paullatzelsperger
Copy link
Member

Feature Request

All Management API endpoints are either restricted to the "admin" role, or are only available to the owner (=participant) of the resource.

In addition, we need a way for a (configurable) user role to override/supersede user permissions. That means, that a certain role, e.g. the "admin", can access/modify/read resources even if they are not the original owner.

Which Areas Would Be Affected?

AuthorizationService

Why Is the Feature Desired?

Super user roles should be able to access all resources.

Solution Proposal

Have a check in the AuthorizationService, that allows for one or several configurable roles to override user permissions. This will most likely require a downcast of the Principal:

@Override
public ServiceResult<Void> isAuthorized(Principal principal, String resourceId, Class<?> resourceClass) {

  if (principal instanceof User user) {
    if (user.getRoles().contains(ROLE_ADMIN)) {
      return ServiceResult.success();
    }
  }
  // ... other checks
}
@paullatzelsperger paullatzelsperger added feature_request New feature request, awaiting triage triage all new issues awaiting classification labels Jan 30, 2024
@paullatzelsperger paullatzelsperger self-assigned this Jan 30, 2024
@paullatzelsperger paullatzelsperger added enhancement New feature or request api and removed feature_request New feature request, awaiting triage triage all new issues awaiting classification labels Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant