final String repositoryName = this.repository.repositoryName();
try {
if (sec instanceof AuthorizationProvider) {
// Delegate to the security context ...
AuthorizationProvider authorizer = (AuthorizationProvider)sec;
Path path = pathSupplier != null ? pathSupplier.getAbsolutePath() : null;
if (path != null) {
assert path.isAbsolute() : "The path (if provided) must be absolute";
hasPermission = authorizer.hasPermission(context, repositoryName, repositoryName, workspaceName, path,
actions);
if (checkAcl && hasPermission) {
hasPermission = acm.hasPermission(path, actions);
}
return hasPermission;
}
}
if (sec instanceof AdvancedAuthorizationProvider) {
// Delegate to the security context ...
AdvancedAuthorizationProvider authorizer = (AdvancedAuthorizationProvider)sec;
Path path = pathSupplier != null ? pathSupplier.getAbsolutePath() : null;
if (path != null) {
assert path.isAbsolute() : "The path (if provided) must be absolute";
hasPermission = authorizer.hasPermission(authorizerContext, path, actions);
if (checkAcl && hasPermission) {
hasPermission = acm.hasPermission(path, actions);
}
return hasPermission;