if(processEngineConfiguration.isAuthorizationEnabled() && currentAuthentication != null) {
boolean isAuthorized = isAuthorized(currentAuthentication.getUserId(), currentAuthentication.getGroupIds(), permission, resource, resourceId);
if (!isAuthorized) {
throw new AuthorizationException(currentAuthentication.getUserId(), permission.getName(), resource.resourceName(), resourceId);
}
}
}