Source:
<code>private final boolean hasPermission( String workspaceName, Path path, String... actions ) { assert path == null ? true : path.isAbsolute() : "The path (if provided) must be absolute"; SecurityContext sec = context.getSecurityContext(); final String repositoryName = this.repository.repositoryName(); if (sec instanceof AuthorizationProvider) { AuthorizationProvider authorizer = (AuthorizationProvider)sec; <START> return authorizer.hasPermission(context, repositoryName, repositoryName, workspaceName, path, actions); <END> } boolean hasPermission = true; if (sec instanceof AdvancedAuthorizationProvider) { AdvancedAuthorizationProvider authorizer = (AdvancedAuthorizationProvider)sec; hasPermission = authorizer.hasPermission(authorizerContext, path, actions); if (hasPermission) { hasPermission = acm.hasPermission(path, actions); } return hasPermission; } for (String action : actions) { if (ModeShapePermissions.READ.equals(action)) { hasPermission &= hasRole(sec, ModeShapeRoles.READONLY, repositoryName, workspaceName) || hasRole(sec, ModeShapeRoles.READWRITE, repositoryName, workspaceName) || hasRole(sec, ModeShapeRoles.ADMIN, repositoryName, workspaceName); } else if (ModeShapePermissions.REGISTER_NAMESPACE.equals(action) || ModeShapePermissions.REGISTER_TYPE.equals(action) || ModeShapePermissions.UNLOCK_ANY.equals(action) || ModeShapePermissions.CREATE_WORKSPACE.equals(action) || ModeShapePermissions.DELETE_WORKSPACE.equals(action) || ModeShapePermissions.MONITOR.equals(action) || ModeShapePermissions.DELETE_WORKSPACE.equals(action) || ModeShapePermissions.INDEX_WORKSPACE.equals(action)) { hasPermission &= hasRole(sec, ModeShapeRoles.ADMIN, repositoryName, workspaceName); } else { hasPermission &= hasRole(sec, ModeShapeRoles.ADMIN, repositoryName, workspaceName) || hasRole(sec, ModeShapeRoles.READWRITE, repositoryName, workspaceName); } } if (hasPermission) { hasPermission = acm.hasPermission(path, actions); } return hasPermission; }</code><technical_language>want behavior in 2 cases ? i.e. if authorizer.hasPermission() return acm.hasPermission(path, actions), in other words ACLs account always</technical_language>

Target:
private final boolean hasPermission( String workspaceName, Path path, String... actions ) { assert path == null ? true : path.isAbsolute() : "The path (if provided) must be absolute"; SecurityContext sec = context.getSecurityContext(); boolean hasPermission = true; final String repositoryName = this.repository.repositoryName(); if (sec instanceof AuthorizationProvider) { AuthorizationProvider authorizer = (AuthorizationProvider)sec; hasPermission = authorizer.hasPermission(context, repositoryName, repositoryName, workspaceName, path, actions); if (hasPermission) { hasPermission = acm.hasPermission(path, actions); } return hasPermission; } if (sec instanceof AdvancedAuthorizationProvider) { AdvancedAuthorizationProvider authorizer = (AdvancedAuthorizationProvider)sec; hasPermission = authorizer.hasPermission(authorizerContext, path, actions); if (hasPermission) { hasPermission = acm.hasPermission(path, actions); } return hasPermission; } for (String action : actions) { if (ModeShapePermissions.READ.equals(action)) { hasPermission &= hasRole(sec, ModeShapeRoles.READONLY, repositoryName, workspaceName) || hasRole(sec, ModeShapeRoles.READWRITE, repositoryName, workspaceName) || hasRole(sec, ModeShapeRoles.ADMIN, repositoryName, workspaceName); } else if (ModeShapePermissions.REGISTER_NAMESPACE.equals(action) || ModeShapePermissions.REGISTER_TYPE.equals(action) || ModeShapePermissions.UNLOCK_ANY.equals(action) || ModeShapePermissions.CREATE_WORKSPACE.equals(action) || ModeShapePermissions.DELETE_WORKSPACE.equals(action) || ModeShapePermissions.MONITOR.equals(action) || ModeShapePermissions.DELETE_WORKSPACE.equals(action) || ModeShapePermissions.INDEX_WORKSPACE.equals(action)) { hasPermission &= hasRole(sec, ModeShapeRoles.ADMIN, repositoryName, workspaceName); } else { hasPermission &= hasRole(sec, ModeShapeRoles.ADMIN, repositoryName, workspaceName) || hasRole(sec, ModeShapeRoles.READWRITE, repositoryName, workspaceName); } } if (hasPermission) { hasPermission = acm.hasPermission(path, actions); } return hasPermission; }