repositoryFileAcl = pur.getAcl( repositoryFile.getId() );
@Override public void setAcl( ObjectId fileId, ObjectAcl objectAcl ) throws KettleException { try { RepositoryFileAcl acl = pur.getAcl( fileId.getId() ); RepositoryFileAcl.Builder newAclBuilder = new RepositoryFileAcl.Builder( acl ).entriesInheriting( objectAcl.isEntriesInheriting() ).clearAces(); if ( !objectAcl.isEntriesInheriting() ) { List<ObjectAce> aces = objectAcl.getAces(); for ( ObjectAce objectAce : aces ) { EnumSet<RepositoryFilePermission> permissions = objectAce.getPermissions(); EnumSet<RepositoryFilePermission> permissionSet = EnumSet.noneOf( RepositoryFilePermission.class ); ObjectRecipient recipient = objectAce.getRecipient(); RepositoryFileSid sid; if ( recipient.getType().equals( Type.ROLE ) ) { sid = new RepositoryFileSid( recipient.getName(), RepositoryFileSid.Type.ROLE ); } else { sid = new RepositoryFileSid( recipient.getName() ); } if ( permissions != null ) { permissionSet.addAll( permissions ); } newAclBuilder.ace( sid, permissionSet ); } } pur.updateAcl( newAclBuilder.build() ); } catch ( Exception drfe ) { // The user does not have rights to view or set the acl information. throw new KettleException( drfe ); } }
RepositoryFileAcl acl = null; try { acl = pur.getAcl( fileId.getId() ); } catch ( Exception drfe ) {
public RepositoryFileAcl call() throws Exception { return delegatee.getAcl( fileId ); } }, Messages.getInstance().getString( "ExceptionLoggingDecorator.getAcl", fileId ) ); //$NON-NLS-1$
/** * Returns ACL for file. * * @param fileId * file id * @return access control list */ @Override public RepositoryFileAcl getAcl( final Serializable fileId ) { return repository.getAcl( fileId ); }
public RepositoryFileAclDto getAcl( String fileId ) { if ( repo == null ) { // many tests do not have a repo setup. return null; } return repositoryFileAclAdapter.marshal( repo.getAcl( fileId ) ); }
PentahoSystem.registerObject( unifiedRepository ); RepositoryFileAcl acl = new RepositoryFileAcl.Builder("admin").build(); when( unifiedRepository.getAcl( anyString() )).thenReturn( acl );
@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; } } );
acl = unifiedRepository.getAcl( aclNode.getId() ); } catch ( Exception e ) { return null;