public boolean canAccess( Authentication user, LayerInfo layer, AccessMode mode, boolean directAccess) { checkPropertyFile(); if (layer.getResource() == null) { LOGGER.log( Level.FINE, "Layer " + layer + " has no attached resource, " + "assuming it's possible to access it"); // it's a layer whose resource we don't know about return true; } else { return canAccess(user, layer.getResource(), mode, directAccess); } }
public boolean canAccess(Authentication user, WorkspaceInfo workspace, AccessMode mode) { checkPropertyFile(); SecureTreeNode node = root.getDeepestNode(new String[] {workspace.getName()}); if (node.canAccess(user, mode)) { return true; } // perform a drill down search, we still allow access to the workspace // if there is anything inside the workspace that can be read (otherwise // we are denying access to everything below it, which is not the spirit of the // tree override design) if (mode == AccessMode.READ && canAccessChild(node, user, mode)) { return true; } else { return false; } }
public boolean canAccess( Authentication user, ResourceInfo resource, AccessMode mode, boolean directAccess) { checkPropertyFile(); String workspace; final String resourceName = resource.getName();