diff --git a/src/main/java/edu/stanford/protege/webprotege/authorization/GetAuthorizedActionsHandler.java b/src/main/java/edu/stanford/protege/webprotege/authorization/GetAuthorizedActionsHandler.java index 9df27fb..a749a7e 100644 --- a/src/main/java/edu/stanford/protege/webprotege/authorization/GetAuthorizedActionsHandler.java +++ b/src/main/java/edu/stanford/protege/webprotege/authorization/GetAuthorizedActionsHandler.java @@ -46,7 +46,30 @@ public Class getRequestClass() { @Override public Mono handleRequest(GetAuthorizedActionsRequest request, ExecutionContext executionContext) { - if(request.resource().isApplication()) { + /* + ToDo: Understand why we need this if else here + */ +// if(request.resource().isApplication()) { +// try { +// List roleIds = tokenValidator.getTokenClaims(executionContext.jwt()).stream() +// .map(RoleId::new) +// .toList(); +// Set actions = new HashSet<>(roleOracle.getActionsAssociatedToRoles(roleIds)); +// return Mono.just(new GetAuthorizedActionsResponse(request.resource(), +// request.subject(), +// actions)); +// +// } catch (VerificationException e) { +// throw new RuntimeException(e); +// } +// }else { +// var actionClosure = accessManager.getActionClosure(request.subject(), +// request.resource()); +// return Mono.just(new GetAuthorizedActionsResponse(request.resource(), +// request.subject(), +// actionClosure)); +// } + try { List roleIds = tokenValidator.getTokenClaims(executionContext.jwt()).stream() .map(RoleId::new) @@ -59,12 +82,5 @@ public Mono handleRequest(GetAuthorizedActionsRequ } catch (VerificationException e) { throw new RuntimeException(e); } - }else { - var actionClosure = accessManager.getActionClosure(request.subject(), - request.resource()); - return Mono.just(new GetAuthorizedActionsResponse(request.resource(), - request.subject(), - actionClosure)); - } } }