Replies: 1 comment 2 replies
-
Expression is the base class of the AST for permission checks. The branches are boolean operators like AND and OR. The leaves are typically CheckExpressions. You can either:
The latter is a bit more work but probably the better way to go. Important note, the original text in the permission ("User is not allowed to access this object") is not stored directly in the expression but rather in the EntityDictionary: Hope that helps. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have created a class that implements
ErrorMapper
interface. I see that theException
class has access toExpression
via((ForbiddenAccessException) exception).getExpression().get()
, but there is no way to get the pure expression for which thisForbiddenAccessException
was thrown.For example, if I have a
@SecurityCheck("user must have this role")
and then add it on an entity class like@ReadPermission(expression = "user must have this role")
, is there any way currently to access this expression viaForbiddenAccessException
, or some changes need to be made?This would be needed to change what the error message says, depending on which expression check failed.
Code example:
Beta Was this translation helpful? Give feedback.
All reactions