I created a behaviour that executes some logic to check if the user is privileged to move/delete/update a node ( BeforeDeleteNodePolicy, OnUpdatePropertiesPolicy, BeforeCheckOut).
If the user is not privileged, it throws AlfrescoRuntimeException and then the whole action is canceled. The problem is about the logs which show the stack trace of every AlfrescoRuntimeException thrown in that blockade.
Is there a way not to log those exceptions from the blockade? Or is there another way to cancel a user's action?
The blockade is based on the type and aspects of the node so it can not be done using permissions.
You can try to throw AccessDeniedException instead which should hopefully be passed on to the client / caller instead of being logged. Of course the pass-on / logging depends on the code path via which the policies / behaviours are triggered, so it can never be guaranteed that your exception won't be logged anywhere along the call path.
Thank you @afaust for the tip but unfortunately, AccessDeniedException is also logged (like it's still a WebScriptException)
example-addon-acs_1 | 2021-07-12 11:00:44,171 ERROR [extensions.webscripts.AbstractRuntime] [http-nio-8080-exec-2] Exception from executeScript: 06120005 JavaException: org.alfresco.repo.security.permissions.AccessDeniedException: 06120026You do not have permission to check out
example-addon-acs_1 | org.springframework.extensions.webscripts.WebScriptException: 06120005 JavaException: org.alfresco.repo.security.permissions.AccessDeniedException: 06120026 You do not have permission to check out