use of org.pentaho.platform.api.repository2.unified.RepositoryFileAcl in project pentaho-platform by pentaho.
the class RepositoryFileImportFileHandlerTest method testImportNewFileWithManifestOwnerApplied.
@Test
public void testImportNewFileWithManifestOwnerApplied() throws Exception {
ImportTestBuilder importTesterBuilder = new ImportTestBuilder();
importTesterBuilder.hasManifest(true).applyAclSettings(false).overwriteAclSettings(true).retainOwnership(false).build().initialSetup().execute();
RepositoryFile repositoryFile = mockRepository.getFile(PATH + "/" + TARGET_RESOURCE_NAME);
assertNotNull(repositoryFile);
RepositoryFileAcl acl = mockRepository.getAcl(repositoryFile.getId());
assertHasDefaultPermissions(acl);
assertHasManifestOwner(acl);
}
use of org.pentaho.platform.api.repository2.unified.RepositoryFileAcl in project pentaho-platform by pentaho.
the class RepositoryFileImportFileHandlerTest method testImportNewFolderWithNoManifest.
@Test
public void testImportNewFolderWithNoManifest() throws Exception {
ImportTestBuilder importTesterBuilder = new ImportTestBuilder();
importTesterBuilder.folder(true).path("/").build().initialSetup().execute();
RepositoryFile repositoryFile = mockRepository.getFile("/" + TARGET_RESOURCE_NAME);
assertNotNull(repositoryFile);
assertTrue(repositoryFile.isFolder());
RepositoryFileAcl acl = mockRepository.getAcl(repositoryFile.getId());
assertHasDefaultPermissions(acl);
assertHasDefaultOwner(acl);
}
use of org.pentaho.platform.api.repository2.unified.RepositoryFileAcl in project pentaho-platform by pentaho.
the class RepositoryFileImportFileHandlerTest method testImportExistingFileWithManifestPermissions.
@Test
public void testImportExistingFileWithManifestPermissions() throws Exception {
ImportTestBuilder importTesterBuilder = new ImportTestBuilder();
importTesterBuilder.fileExists(true).hasManifest(true).overwriteFileIfExists(true).retainOwnership(true).applyAclSettings(true).overwriteAclSettings(true).build().initialSetup().execute();
RepositoryFile repositoryFile = mockRepository.getFile(PATH + "/" + TARGET_RESOURCE_NAME);
assertNotNull(repositoryFile);
RepositoryFileAcl acl = mockRepository.getAcl(repositoryFile.getId());
assertHasManifestPermissions(acl);
assertHasDefaultOwner(acl);
}
use of org.pentaho.platform.api.repository2.unified.RepositoryFileAcl in project pentaho-platform by pentaho.
the class RepositoryFileImportFileHandlerTest method testImportExistingFileWithManifestNotApplied.
@Test
public void testImportExistingFileWithManifestNotApplied() throws Exception {
ImportTestBuilder importTesterBuilder = new ImportTestBuilder();
importTesterBuilder.fileExists(true).hasManifest(true).retainOwnership(true).overwriteFileIfExists(true).build().initialSetup().execute();
RepositoryFile repositoryFile = mockRepository.getFile(PATH + "/" + TARGET_RESOURCE_NAME);
assertNotNull(repositoryFile);
RepositoryFileAcl acl = mockRepository.getAcl(repositoryFile.getId());
assertHasDefaultPermissions(acl);
assertHasDefaultOwner(acl);
}
use of org.pentaho.platform.api.repository2.unified.RepositoryFileAcl in project pentaho-platform by pentaho.
the class RepositoryFileImportFileHandlerTest method testImportNewFileWithManifestPermissionsApplied.
@Test
public void testImportNewFileWithManifestPermissionsApplied() throws Exception {
ImportTestBuilder importTesterBuilder = new ImportTestBuilder();
importTesterBuilder.hasManifest(true).applyAclSettings(true).overwriteAclSettings(true).retainOwnership(true).build().initialSetup().execute();
RepositoryFile repositoryFile = mockRepository.getFile(PATH + "/" + TARGET_RESOURCE_NAME);
assertNotNull(repositoryFile);
RepositoryFileAcl acl = mockRepository.getAcl(repositoryFile.getId());
assertHasManifestPermissions(acl);
assertHasDefaultOwner(acl);
}
Aggregations