entityMetaData.setTitle( repositoryFile.getTitle() );
setPath( adjustedPath );
}
private void createEntityAcl( RepositoryFileAcl repositoryFileAcl ) {
DefaultTenantedPrincipleNameResolver nameResolver = new DefaultTenantedPrincipleNameResolver();
if ( repositoryFileAcl == null ) {
return;
}
entityAcl = new EntityAcl();
entityAcl.setEntriesInheriting( repositoryFileAcl.isEntriesInheriting() );
entityAcl.setOwner( nameResolver.getPrincipleName( repositoryFileAcl.getOwner().getName() ) );
entityAcl.setOwnerType( repositoryFileAcl.getOwner().getType().name() );
List<EntityAcl.Aces> aces = entityAcl.getAces();
aces.clear();
for ( RepositoryFileAce repositoryFileAce : repositoryFileAcl.getAces() ) {
EntityAcl.Aces ace = new EntityAcl.Aces();
ace.setRecipient( nameResolver.getPrincipleName( repositoryFileAce.getSid().getName() ) );
ace.setRecipientType( repositoryFileAce.getSid().getType().name() );
List<String> permissions = ace.getPermissions();
for ( RepositoryFilePermission permission : repositoryFileAce.getPermissions() ) {
permissions.add( permission.toString() );
}