Class BuiltInMethods
java.lang.Object
io.helidon.security.abac.policy.el.BuiltInMethods
Built-in methods for expression language evaluation.
These methods are bound in default namespace (without a prefix). Name to use in an expression is the name of the method.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Check if subject has the specified role.static boolean
Check if subject has the specified roles (must have all of them).static boolean
Check if subject has the specified scope.static boolean
Check if subject has the specified scopes (must have all of them).
-
Method Details
-
inRole
Check if subject has the specified role.- Parameters:
subject
- subject of a user or a servicerole
- role the subject should be in- Returns:
- true if the subject is in the role
-
inRoles
Check if subject has the specified roles (must have all of them). If you need to check that subject is in EITHER of the roles, you should combine this will or operator (e.g. inRole(user, "manager") || inRole(user, "admin"))- Parameters:
subject
- subject of a user or a serviceroles
- roles the subject should be in- Returns:
- true if the subject is in all the specified roles
-
inScope
Check if subject has the specified scope.- Parameters:
subject
- subject of a userscope
- scope the subject should have- Returns:
- true if the subject has all the specified scopes
-
inScopes
Check if subject has the specified scopes (must have all of them).- Parameters:
subject
- subject of a userscopes
- scopes the subject should have- Returns:
- true if the subject has all the specified scopes
-