} else { objectAcl.setEntriesInheriting( acl.isEntriesInheriting() ); aces = ( acl.isEntriesInheriting() ) ? pur.getEffectiveAces( acl.getId() ) : acl.getAces();
@Override public boolean matchesSafely( final RepositoryFileAcl acl ) { return ( expectedAcl.getId() != null ? expectedAcl.getId().equals( acl.getId() ) : true ) && expectedAcl.isEntriesInheriting() == acl.isEntriesInheriting() && ( testAcesUsingEquals ? acl.getAces().equals( expectedAcl.getAces() ) : acl.getAces().containsAll( expectedAcl.getAces() ) ); }
@Override public void describeTo( final Description description ) { boolean appended = false; description.appendText( shortName ); description.appendText( "(" ); if ( expectedAcl.getId() != null ) { description.appendText( appended ? "," : "" ); description.appendText( "id=" ); description.appendText( expectedAcl.getId().toString() ); appended = true; } description.appendText( appended ? "," : "" ); description.appendText( "isEntriesInheriting=" ); description.appendText( String.valueOf( expectedAcl.isEntriesInheriting() ) ); appended = true; if ( expectedAcl.getAces() != null ) { description.appendText( appended ? "," : "" ); description.appendText( "aces=" ); description.appendText( expectedAcl.getAces().toString() ); appended = true; } description.appendText( ")" ); }
private List<RepositoryFileAce> internalGetEffectiveAces( final Serializable fileId ) { FileRecord r = idManager.getFileById( fileId ); if ( r.getParent() == null ) { return r.getAcl().getAces(); } else if ( r.getAcl().isEntriesInheriting() == false ) { return r.getAcl().getAces(); } else { return getEffectiveAces( r.getParent().getFile().getId() ); } }
RepositoryFileAcl acl = aclHandler.createDefaultAcl( f ); assertTrue( !acl.isEntriesInheriting() ); assertTrue( acl.getAces().size() == 1 ); assertTrue( "Authenticated".equals( acl.getAces().get( 0 ).getSid().getName().toString() ) ); assertTrue( RepositoryFileSid.Type.ROLE.equals( acl.getAces().get( 0 ).getSid().getType() ) ); assertTrue( acl.getAces().get( 0 ).getPermissions().size() == 1 ); assertTrue( acl.getAces().get( 0 ).getPermissions().contains( RepositoryFilePermission.ALL ) ); System.out.println( acl.getAces() ); assertTrue( acl.getAces().size() == 0 );
@Override public List<RepositoryFileAce> getEffectiveAces( final Serializable fileId, final boolean forceEntriesInheriting ) { FileRecord r = idManager.getFileById( fileId ); if ( r.getParent() != null ) { return getEffectiveAces( r.getParent().getFile().getId() ); } return r.getAcl().getAces(); }
@Override public RepositoryFileAclDto marshal( final RepositoryFileAcl v ) { RepositoryFileAclDto aclDto = new RepositoryFileAclDto(); Serializable id = v.getId(); aclDto.setId( id != null ? id.toString() : null ); RepositoryFileSid owner = v.getOwner(); if ( owner != null ) { aclDto.setOwner( owner.getName() ); aclDto.setOwnerType( owner.getType() != null ? owner.getType().ordinal() : -1 ); } aclDto.setAces( toAcesDto( v.getAces() ), v.isEntriesInheriting() ); return aclDto; }
ITenant principalTenant = null; if ( !acl.isEntriesInheriting() ) { for ( RepositoryFileAce ace : acl.getAces() ) { Principal principal = null; if ( RepositoryFileSid.Type.ROLE == ace.getSid().getType() ) { if ( acl.getAces() != null && acl.getAces().size() > 0 ) { principalTenant = JcrTenantUtils.getRoleNameUtils().getTenant( acl.getAces().get( 0 ).getSid().getName() );
for ( RepositoryFileAce fileAce : acl.getAces() ) { if ( fileAce != null && fileAce.getSid() != null && fileAce.getPermissions() != null ) { for ( RepositoryFilePermission filePermission : fileAce.getPermissions() ) {
@Override public Void call() throws Exception { RepositoryFile aclNode = getAclNode( fileToAddAclFor ); if ( acl == null ) { if ( aclNode != null ) { unifiedRepository.deleteFile( aclNode.getId(), true, Messages.getInstance().getString( "AclNodeHelper.WARN_0001_REMOVE_ACL_NODE", aclNode.getPath() ) ); } // ignore if no ACL node is present. } else { if ( aclNode == null ) { // Create ACL Node with reference to given file. aclNode = createAclNode( fileToAddAclFor ); } // Update ACL on file. RepositoryFileAcl existing = unifiedRepository.getAcl( aclNode.getId() ); RepositoryFileAcl updated = new RepositoryFileAcl.Builder( existing ) .aces( acl.getAces() ) .build(); unifiedRepository.updateAcl( updated ); } return null; } } );
for ( RepositoryFileAce ace : acl.getAces() ) { Principal principal = null; if ( RepositoryFileSid.Type.ROLE == ace.getSid().getType() ) {
aclBuilder.aces( acl.getAces() );