final String workspaceName() { return workspace.getName(); }
final String workspaceName() { return workspace.getName(); }
private String getWorkspaceName() { return session.getWorkspace().getName(); }
private String getWorkspaceName() { return session.getWorkspace().getName(); }
public MergeCommand( AbstractJcrNode targetNode, JcrSession sourceSession, boolean bestEffort, boolean isShallow ) { this.targetNode = targetNode; this.sourceSession = sourceSession; this.cache = this.sourceSession.cache(); this.bestEffort = bestEffort; this.isShallow = isShallow; this.sourceWorkspaceName = sourceSession.getWorkspace().getName(); this.failures = new LinkedList<AbstractJcrNode>(); }
public MergeCommand( AbstractJcrNode targetNode, JcrSession sourceSession, boolean bestEffort, boolean isShallow ) { this.targetNode = targetNode; this.sourceSession = sourceSession; this.cache = this.sourceSession.cache(); this.bestEffort = bestEffort; this.isShallow = isShallow; this.sourceWorkspaceName = sourceSession.getWorkspace().getName(); this.failures = new LinkedList<AbstractJcrNode>(); }
void checkPermission( PathSupplier pathSupplier, String... actions ) throws AccessDeniedException { checkPermission(this.workspace().getName(), pathSupplier, actions); }
void checkPermission( PathSupplier pathSupplier, String... actions ) throws AccessDeniedException { checkPermission(this.workspace().getName(), pathSupplier, actions); }
/** * Throws an {@link AccessControlException} if the current user does not have permission for all of the named actions in the * current workspace, otherwise returns silently. * <p> * The {@code path} parameter is included for future use and is currently ignored * </p> * * @param path the absolute path on which the actions are occurring * @param actions a comma-delimited list of actions to check * @throws AccessDeniedException if the actions cannot be performed on the node at the specified path */ void checkPermission( Path path, String... actions ) throws AccessDeniedException { checkPermission(this.workspace().getName(), path, actions); }
/** * Throws an {@link AccessControlException} if the current user does not have permission for all of the named actions in the * current workspace, otherwise returns silently. * <p> * The {@code path} parameter is included for future use and is currently ignored * </p> * * @param path the absolute path on which the actions are occurring * @param actions a comma-delimited list of actions to check * @throws AccessDeniedException if the actions cannot be performed on the node at the specified path */ void checkPermission( Path path, String... actions ) throws AccessDeniedException { checkPermission(this.workspace().getName(), path, actions); }
void checkPermission( CachedNode node, NodeCache cache, String... actions ) throws AccessDeniedException { checkPermission(this.workspace().getName(), pathSupplierFor(node, cache), actions); }
void checkPermission( CachedNode node, NodeCache cache, String... actions ) throws AccessDeniedException { checkPermission(this.workspace().getName(), pathSupplierFor(node, cache), actions); }
/** * Throws an {@link AccessControlException} if the current user does not have permission for all of the named actions in the * current workspace, otherwise returns silently. * <p> * The {@code path} parameter is included for future use and is currently ignored * </p> * * @param item the property or node on which the actions are occurring * @param actions a comma-delimited list of actions to check * @throws AccessDeniedException if the actions cannot be performed on the node at the specified path */ void checkPermission( AbstractJcrItem item, String... actions ) throws AccessDeniedException { checkPermission(this.workspace().getName(), pathSupplierFor(item), actions); }
/** * Throws an {@link AccessControlException} if the current user does not have permission for all of the named actions in the * current workspace, otherwise returns silently. * <p> * The {@code path} parameter is included for future use and is currently ignored * </p> * * @param item the property or node on which the actions are occurring * @param actions a comma-delimited list of actions to check * @throws AccessDeniedException if the actions cannot be performed on the node at the specified path */ void checkPermission( AbstractJcrItem item, String... actions ) throws AccessDeniedException { checkPermission(this.workspace().getName(), pathSupplierFor(item), actions); }
@Test public void shouldProvideName() throws Exception { assertThat(workspace.getName(), is(workspaceName)); }
@Override public boolean hasPermission( String absPath, String actions ) throws RepositoryException { checkLive(); CheckArg.isNotEmpty(absPath, "absPath"); PathSupplier pathSupplier = pathSupplierFor(absolutePathFor(absPath)); String[] actionsArray = actions.split(","); String workspaceName = this.workspace().getName(); return hasPermission(workspaceName, pathSupplier, actionsArray) && hasPermissionOnExternalPath(pathSupplier, actionsArray); }
@Override public boolean hasPermission( String absPath, String actions ) throws RepositoryException { checkLive(); CheckArg.isNotEmpty(absPath, "absPath"); PathSupplier pathSupplier = pathSupplierFor(absolutePathFor(absPath)); String[] actionsArray = actions.split(","); String workspaceName = this.workspace().getName(); return hasPermission(workspaceName, pathSupplier, actionsArray) && hasPermissionOnExternalPath(pathSupplier, actionsArray); }
protected void validateCrossWorkspaceAction( String srcWorkspace ) throws RepositoryException { CheckArg.isNotEmpty(srcWorkspace, "srcWorkspace"); session.checkLive(); session.checkWorkspacePermission(srcWorkspace, ModeShapePermissions.READ); session.checkWorkspacePermission(getName(), ModeShapePermissions.READ); JcrRepository repository = repository(); if (!repository.hasWorkspace(srcWorkspace)) { throw new NoSuchWorkspaceException(JcrI18n.workspaceNameIsInvalid.text(repository.getName(), srcWorkspace)); } }
protected void validateCrossWorkspaceAction( String srcWorkspace ) throws RepositoryException { CheckArg.isNotEmpty(srcWorkspace, "srcWorkspace"); session.checkLive(); session.checkWorkspacePermission(srcWorkspace, ModeShapePermissions.READ); session.checkWorkspacePermission(getName(), ModeShapePermissions.READ); JcrRepository repository = repository(); if (!repository.hasWorkspace(srcWorkspace)) { throw new NoSuchWorkspaceException(JcrI18n.workspaceNameIsInvalid.text(repository.getName(), srcWorkspace)); } }
@Override public void checkPermission( String path, String actions ) { CheckArg.isNotEmpty(path, "path"); CheckArg.isNotEmpty(actions, "actions"); try { PathSupplier supplier = pathSupplierFor(absolutePathFor(path)); String[] actionsArray = actions.split(","); checkPermission(workspace().getName(), supplier, actionsArray); if (!hasPermissionOnExternalPath(supplier, actionsArray)) { String absPath = supplier.getAbsolutePath().getString(namespaces()); throw new AccessDeniedException(JcrI18n.permissionDenied.text(absPath, actions)); } } catch (RepositoryException e) { throw new AccessControlException(JcrI18n.permissionDenied.text(path, actions)); } }