Hello,I was wondering if there is an way to check for permissions without explicitly setting current user with AuthenticationComponent.setCurrentUser(). I am looking for an API which would resemble to:
hasPermission(NodeRef nodeRef, String authority, String permission);
getPermissions(NodeRef nodeRef, String authority);
// etc…
Right now the only way to do it in scheduled job is:
for ( User user:users ) {
this.authenticationComponent.setCurrentUser( user.getUserName() );
if ( this.permissionService.hasPermission(nodeRef, permission) ) {
// do something
}
}
Am I missing something ?Many thanks in advance,Andrei.