Package io.bdeploy.common.security
Annotation Interface RequiredPermission
Specifies the permission required to access methods.
This annotation can be specified on a class or on method(s). Specifying it at a class level means that it applies to all the methods in the class. Specifying it on a method means that it is applicable to that method only. If applied at both the class and methods level, the method value overrides the class value.
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionThe permission required to access the method -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionReferences a method on the resource which accepts the scope as string, and returns the required minimum permission on that scope.The name of the query parameter / path parameter containing the actual value.booleanWhether the scope is optional.
-
Element Details
-
permission
ScopedPermission.Permission permissionThe permission required to access the method
-
-
-
scope
String scopeThe name of the query parameter / path parameter containing the actual value. The returned value can be used to obtain the value from the actual request URI.- Default:
- ""
-
scopeOptional
boolean scopeOptionalWhether the scope is optional. This can be used when the annotation is placed on the interface, and there are methods with and without the scope parameter.- Default:
- false
-
dynamicPermission
String dynamicPermissionReferences a method on the resource which accepts the scope as string, and returns the required minimum permission on that scope.The referenced method will be called during checks for required permissions on the annotated object, using the value of the parameter denoted by the scope parameter and is expected to return an object of type
ScopedPermission.Permissionornullif no permission is required.- Default:
- ""
-