Skip to content

Commit

Permalink
Allow @ResourceSecurity at the class level
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Dec 16, 2024
1 parent af3a6f3 commit 562e038
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@ public AccessType getAccessType(ResourceInfo resourceInfo)
// check if the resource class has an access type declared for all methods
accessType = resourceAccessTypeLoader.getAccessType(resourceInfo.getResourceClass());
if (accessType.isPresent()) {
verifyNotTrinoResource(resourceInfo);
return accessType.get();
}
// in some cases there the resource is a nested class, so check the parent class
// we currently only check one level, but we could handle multiple nesting levels if necessary
if (resourceInfo.getResourceClass().getDeclaringClass() != null) {
accessType = resourceAccessTypeLoader.getAccessType(resourceInfo.getResourceClass().getDeclaringClass());
if (accessType.isPresent()) {
verifyNotTrinoResource(resourceInfo);
return accessType.get();
}
}
Expand Down

0 comments on commit 562e038

Please sign in to comment.