/** * @see org.apache.jackrabbit.core.security.authorization.AccessControlProvider#getEditor(Session) */ public AccessControlEditor getEditor(Session session) { checkInitialized(); return new ACLEditor(session, this, allowUnknownPrincipals); }
/** * @see EntryCollector#getEntries(org.apache.jackrabbit.core.id.NodeId) */ @Override protected Entries getEntries( NodeId nodeId ) throws RepositoryException { Entries entries = getCache().get( nodeId ); if ( entries == null ) { // fetch entries and update the cache NodeImpl n = getNodeById( nodeId ); entries = updateCache( n ); } return entries; }
/** * @see org.apache.jackrabbit.core.security.authorization.AccessControlProvider#compilePermissions(Set) */ public CompiledPermissions compilePermissions(Set<Principal> principals) throws RepositoryException { checkInitialized(); if (isAdminOrSystem(principals)) { return getAdminPermissions(); } else if (isReadOnly(principals)) { return getReadOnlyPermissions(); } else { return new CompiledPermissionsImpl(principals, session, entryCollector, this, true); } }
/** * @see EntryCollector#getEntries(org.apache.jackrabbit.core.NodeImpl) */ @Override protected PentahoEntries getEntries( NodeImpl node ) throws RepositoryException { NodeId nodeId = node.getNodeId(); Entries entries = getCache().get( nodeId ); if ( entries == null ) { // fetch entries and update the cache entries = updateCache( node ); } return entries instanceof PentahoEntries ? (PentahoEntries) entries : new PentahoEntries( entries ); }
/** * @see EntryCollector#getEntries(org.apache.jackrabbit.core.id.NodeId) */ @Override protected Entries getEntries(NodeId nodeId) throws RepositoryException { Entries entries = cache.get(nodeId); if (entries == null) { // fetch entries and update the cache NodeImpl n = getNodeById(nodeId); entries = updateCache(n); } return entries; }
/** * @see AccessControlEditor#getPolicies(String) */ public AccessControlPolicy[] getPolicies(String nodePath) throws AccessControlException, PathNotFoundException, RepositoryException { checkProtectsNode(nodePath); NodeImpl aclNode = getAclNode(nodePath); if (aclNode == null) { return new AccessControlPolicy[0]; } else { return new AccessControlPolicy[] {getACL(aclNode, nodePath)}; } }
/** * * @param nodeId * @return * @throws RepositoryException */ protected Entries getEntries(NodeId nodeId) throws RepositoryException { NodeImpl node = getNodeById(nodeId); return getEntries(node); }
/** * See {@link CachingEntryCollector#updateCache(NodeImpl)} ; this variant runs fully synchronized */ synchronized private Entries synchronizedUpdateCache(NodeImpl node) throws RepositoryException { return internalUpdateCache(node); }
private Entry(NodeId id, String principalName, boolean isGroupEntry, PrivilegeBits privilegeBits, boolean allow, String path, Value globValue) throws RepositoryException { this.principalName = principalName; this.isGroupEntry = isGroupEntry; this.privilegeBits = privilegeBits; this.isAllow = allow; this.id = id; this.pattern = calculatePattern(path, globValue); this.hasRestrictions = (globValue != null); }
String getPath() throws RepositoryException { if (itemPath == null) { itemPath = pathProvider.getPath(); } return itemPath; }
@SuppressWarnings( "nls" ) @Override public String toString() { return "MagicPrincipal [name=" + getName() + "]"; }
/** * Create a new entry omitting any validation checks. * * @param principal * @param privileges * @param isAllow * @param restrictions * @return A new entry */ Entry createEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String,Value> restrictions) throws RepositoryException { return new Entry(principal, privileges, isAllow, restrictions); }
public void testCacheUnderLoad() throws Exception { runTestUnderLoad(new TestInvokation() { public void runTest() throws Exception { testCache(); } }); }
@Override protected JackrabbitAccessControlList getPolicy(AccessControlManager acMgr, String path, Principal princ) throws RepositoryException, NotExecutableException { return EvaluationUtil.getPolicy(acMgr, path, princ); } @Override
/** * @see org.apache.jackrabbit.core.security.authorization.AccessControlProvider#compilePermissions(Set) */ public CompiledPermissions compilePermissions(Set<Principal> principals) throws RepositoryException { checkInitialized(); if (isAdminOrSystem(principals)) { return getAdminPermissions(); } else if (isReadOnly(principals)) { return getReadOnlyPermissions(); } else { return new CompiledPermissionsImpl(principals, session, entryCollector, this, true); } }
/** * @see org.apache.jackrabbit.core.security.authorization.AccessControlProvider#getEditor(Session) */ public AccessControlEditor getEditor(Session session) { checkInitialized(); return new ACLEditor(session, this, allowUnknownPrincipals); }
/** * @see EntryCollector#getEntries(org.apache.jackrabbit.core.id.NodeId) */ @Override protected Entries getEntries(NodeId nodeId) throws RepositoryException { Entries entries = cache.get(nodeId); if (entries == null) { // fetch entries and update the cache NodeImpl n = getNodeById(nodeId); entries = updateCache(n); } return entries; }
/** * See {@link CachingEntryCollector#updateCache(NodeImpl)} ; this variant runs fully parallel */ private Entries parallelUpdateCache(NodeImpl node) throws RepositoryException { return internalUpdateCache(node); }