private boolean matches(NodeImpl result) throws RepositoryException { Name ntName = ((NodeTypeImpl) result.getPrimaryNodeType()).getQName(); switch (authorizableType) { case UserManager.SEARCH_TYPE_GROUP: return UserConstants.NT_REP_GROUP.equals(ntName); case UserManager.SEARCH_TYPE_USER: return UserConstants.NT_REP_USER.equals(ntName); default: return UserConstants.NT_REP_USER.equals(ntName) || UserConstants.NT_REP_GROUP.equals(ntName); } } }
private boolean matches(NodeImpl result) throws RepositoryException { Name ntName = ((NodeTypeImpl) result.getPrimaryNodeType()).getQName(); switch (authorizableType) { case UserManager.SEARCH_TYPE_GROUP: return UserConstants.NT_REP_GROUP.equals(ntName); case UserManager.SEARCH_TYPE_USER: return UserConstants.NT_REP_USER.equals(ntName); default: return UserConstants.NT_REP_USER.equals(ntName) || UserConstants.NT_REP_GROUP.equals(ntName); } } }
/** * Test if the given node is itself a rep:ACL or a rep:ACE node. * @see org.apache.jackrabbit.core.security.authorization.AccessControlUtils#isAcItem(org.apache.jackrabbit.core.ItemImpl) */ public boolean isAcItem(ItemImpl item) throws RepositoryException { NodeImpl n = ((item.isNode()) ? (NodeImpl) item : (NodeImpl) item.getParent()); Name ntName = ((NodeTypeImpl) n.getPrimaryNodeType()).getQName(); return ntName.equals(NT_REP_ACL) || ntName.equals(NT_REP_GRANT_ACE) || ntName.equals(NT_REP_DENY_ACE); }
/** * Test if the given node is itself a rep:ACL or a rep:ACE node. * @see org.apache.jackrabbit.core.security.authorization.AccessControlUtils#isAcItem(org.apache.jackrabbit.core.ItemImpl) */ public boolean isAcItem(ItemImpl item) throws RepositoryException { NodeImpl n = ((item.isNode()) ? (NodeImpl) item : (NodeImpl) item.getParent()); Name ntName = ((NodeTypeImpl) n.getPrimaryNodeType()).getQName(); return ntName.equals(NT_REP_ACL) || ntName.equals(NT_REP_GRANT_ACE) || ntName.equals(NT_REP_DENY_ACE); }
/** * Returns the given <code>targetNode</code> unless the node itself stores * access control information in which case it's nearest non-ac-parent is * searched and returned. * * @param targetNode The node for which AC information needs to be retrieved. * @param isAcItem true if the specified target node defines access control * content; false otherwise. * @return the given <code>targetNode</code> or the nearest non-ac-parent * in case the <code>targetNode</code> itself defines access control content. * @throws RepositoryException if an error occurs */ static NodeImpl getNode(NodeImpl targetNode, boolean isAcItem) throws RepositoryException { NodeImpl node; if (isAcItem) { Name ntName = ((NodeTypeImpl) targetNode.getPrimaryNodeType()).getQName(); if (ntName.equals(NT_REP_ACL)) { node = (NodeImpl) targetNode.getParent(); } else if (ntName.equals(NT_REP_GRANT_ACE) || ntName.equals(NT_REP_DENY_ACE)) { node = (NodeImpl) targetNode.getParent().getParent(); } else { // target node already points to the nearest existing ancestor of the ac-item node = targetNode; } } else { node = targetNode; } return node; } }
/** * Returns the given <code>targetNode</code> unless the node itself stores * access control information in which case it's nearest non-ac-parent is * searched and returned. * * @param targetNode The node for which AC information needs to be retrieved. * @param isAcItem true if the specified target node defines access control * content; false otherwise. * @return the given <code>targetNode</code> or the nearest non-ac-parent * in case the <code>targetNode</code> itself defines access control content. * @throws RepositoryException if an error occurs */ static NodeImpl getNode(NodeImpl targetNode, boolean isAcItem) throws RepositoryException { NodeImpl node; if (isAcItem) { Name ntName = ((NodeTypeImpl) targetNode.getPrimaryNodeType()).getQName(); if (ntName.equals(NT_REP_ACL)) { node = (NodeImpl) targetNode.getParent(); } else if (ntName.equals(NT_REP_GRANT_ACE) || ntName.equals(NT_REP_DENY_ACE)) { node = (NodeImpl) targetNode.getParent().getParent(); } else { // target node already points to the nearest existing ancestor of the ac-item node = targetNode; } } else { node = targetNode; } return node; } }
if (type == Event.PROPERTY_ADDED || type == Event.PROPERTY_CHANGED) { Property p = systemSession.getProperty(ev.getPath()); Name declNtName = ((NodeTypeImpl) p.getDefinition().getDeclaringNodeType()).getQName(); clear = NT_REP_MEMBERS.equals(declNtName); } else { Name ntName = ((NodeTypeImpl) n.getPrimaryNodeType()).getQName(); clear = (UserConstants.NT_REP_MEMBERS.equals(ntName));
if (type == Event.PROPERTY_ADDED || type == Event.PROPERTY_CHANGED) { Property p = systemSession.getProperty(ev.getPath()); Name declNtName = ((NodeTypeImpl) p.getDefinition().getDeclaringNodeType()).getQName(); clear = NT_REP_MEMBERS.equals(declNtName); } else { Name ntName = ((NodeTypeImpl) n.getPrimaryNodeType()).getQName(); clear = (UserConstants.NT_REP_MEMBERS.equals(ntName));
/** * Adds a subtree of itemstates as 'removed' to a list of events * * @param events * @param parent * @param node * @throws RepositoryException */ private void recursiveRemove( List<EventState> events, NodeImpl parent, NodeImpl node) throws RepositoryException { events.add(EventState.childNodeRemoved( parent.getNodeId(), parent.getPrimaryPath(), node.getNodeId(), node.getPrimaryPath().getLastElement(), ((NodeTypeImpl) parent.getPrimaryNodeType()).getQName(), parent.getMixinTypeNames(), node.getSession() )); NodeIterator niter = node.getNodes(); while (niter.hasNext()) { NodeImpl n = (NodeImpl) niter.nextNode(); recursiveRemove(events, node, n); } } }
/** * Adds a subtree of itemstates as 'removed' to a list of events * * @param events * @param parent * @param node * @throws RepositoryException */ private void recursiveRemove( List<EventState> events, NodeImpl parent, NodeImpl node) throws RepositoryException { events.add(EventState.childNodeRemoved( parent.getNodeId(), parent.getPrimaryPath(), node.getNodeId(), node.getPrimaryPath().getLastElement(), ((NodeTypeImpl) parent.getPrimaryNodeType()).getQName(), parent.getMixinTypeNames(), node.getSession() )); NodeIterator niter = node.getNodes(); while (niter.hasNext()) { NodeImpl n = (NodeImpl) niter.nextNode(); recursiveRemove(events, node, n); } } }
if (UserConstants.NT_REP_MEMBERS.equals(((NodeTypeImpl) parent.getPrimaryNodeType()).getQName())) { clearCache();
if (UserConstants.NT_REP_MEMBERS.equals(((NodeTypeImpl) parent.getPrimaryNodeType()).getQName())) { clearCache();
node.getNodeId(), node.getPrimaryPath().getLastElement(), ((NodeTypeImpl) parent.getPrimaryNodeType()).getQName(), parent.getMixinTypeNames(), node.getSession() node.getPrimaryPath(), prop.getPrimaryPath().getLastElement(), ((NodeTypeImpl) node.getPrimaryNodeType()).getQName(), node.getMixinTypeNames(), node.getSession()
node.getNodeId(), node.getPrimaryPath().getLastElement(), ((NodeTypeImpl) parent.getPrimaryNodeType()).getQName(), parent.getMixinTypeNames(), node.getSession() node.getPrimaryPath(), prop.getPrimaryPath().getLastElement(), ((NodeTypeImpl) node.getPrimaryNodeType()).getQName(), node.getMixinTypeNames(), node.getSession()
org.apache.jackrabbit.spi.commons.nodetype.NodeDefinitionImpl newTargetDef; try { newTargetDef = parent.getApplicableChildNodeDefinition(qName, nt.getQName()); } catch (RepositoryException re) { String msg = safeGetJCRPath() + ": no definition found in parent node's node type for renamed node";
id, nodeType.getQName(), getNodeId(), ItemState.STATUS_NEW);
id, nodeType.getQName(), getNodeId(), ItemState.STATUS_NEW);