protected PentahoCompiledPermissionsImpl getCompiledPermissions( Set<Principal> principals ) throws RepositoryException { // check the cache first if ( compiledPermissionsCache.containsKey( principals.hashCode() ) ) { return compiledPermissionsCache.get( principals.hashCode() ); } PentahoCompiledPermissionsImpl compiledPermissions = new PentahoCompiledPermissionsImpl( principals, session, entryCollector, this, true ); compiledPermissionsCache.put( principals.hashCode(), compiledPermissions ); return compiledPermissions; }
/** * We override this method as the superclass implementation caches permissions in an LRU cache. * Other than not caching the result the functionality is identical to {@link AbstractCompiledPermissions#getResult } * * @param absPath * @return CompiledPermissions * @throws RepositoryException */ @Override public Result getResult( Path absPath ) throws RepositoryException { Result result; synchronized ( monitor ) { if ( absPath == null ) { result = buildRepositoryResult(); } else { result = buildResult( absPath ); } } return result; } }
/** * @see org.apache.jackrabbit.core.security.authorization.AccessControlListener# acModified(org.apache.jackrabbit * .core.security.authorization.AccessControlModifications) */ public void acModified( AccessControlModifications modifications ) { // ignore the details of the modifications and clear all caches. clearCache(); }
isLocal && isValidPentahoNode( node ) && !isEntriesInheriting( node ); if ( matchesParent || isLocalAndDoesNotInheritPermissions ) { if ( isAllow ) {
@Override protected Result buildRepositoryResult() throws RepositoryException { return buildResult( null, true, false, new EntryFilterImpl( principalNames, session.getQPath( "/" ), session ) ); }
private boolean isValidPentahoNode( final NodeImpl node ) throws RepositoryException { return node != null && isBelowRootFolder( node ) && JcrRepositoryFileUtils.isPentahoHierarchyNode( session, new PentahoJcrConstants( session ), node ); }
AbstractCompiledPermissions.Result result1 = cp.getResult( mock( Path.class ) ); AbstractCompiledPermissions.Result result2 = cp.getResult( mock( Path.class ) ); assertSame( result1, res1 ); assertSame( result2, res2 ); result1 = cp.getResult( null ); result2 = cp.getResult( null ); assertSame( result1, res1 ); assertSame( result2, res2 );
Result result = buildResult( node, isExistingNode, isAcItem, filter ); canRead = result.grants( Permission.READ ); } else {
return buildResult( node, existingNode, isAcItem, new PentahoEntryFilterImpl( principalNames, absPath, session ) );