use of org.pentaho.di.repository.pur.model.RepositoryObjectRecipient in project pentaho-kettle by pentaho.
the class UIRepositoryObjectAclsTest method createObjectAce.
private ObjectAce createObjectAce(String recipientName) {
ObjectRecipient objectRecipient = new RepositoryObjectRecipient(recipientName, ObjectRecipient.Type.USER);
ObjectAce objectAce = new RepositoryObjectAce(objectRecipient, EnumSet.of(RepositoryFilePermission.READ, RepositoryFilePermission.WRITE));
return objectAce;
}
use of org.pentaho.di.repository.pur.model.RepositoryObjectRecipient in project pentaho-kettle by pentaho.
the class UIRepositoryObjectAclsTest method beforeTest.
@Before
public void beforeTest() {
repositoryObjectAcls = new UIRepositoryObjectAcls();
repObjectAcl = new RepositoryObjectAcl(new RepositoryObjectRecipient(RECIPIENT0, Type.ROLE));
// The fact that the next line is needed to avoid an NPE on many of the methods, ( from doing an addAll(null) ),
// might indicate a bug but I'm not comfortable fixing it at this time since something might depend
// on UIRepositoryObjectAcls.getAcls() delivering null rather than an empty list.
repositoryObjectAcls.setObjectAcl(repObjectAcl);
objectAcl1 = new UIRepositoryObjectAcl(createObjectAce(RECIPIENT1));
objectAcl2 = new UIRepositoryObjectAcl(createObjectAce(RECIPIENT2));
objectAcl3 = new UIRepositoryObjectAcl(createObjectAce(RECIPIENT3));
}
use of org.pentaho.di.repository.pur.model.RepositoryObjectRecipient in project pentaho-kettle by pentaho.
the class UIRepositoryObjectAclsTest method testBooleanFlags.
@Test
public void testBooleanFlags() {
List<UIRepositoryObjectAcl> originalUIAcls = Arrays.asList(new UIRepositoryObjectAcl[] { objectAcl1, objectAcl2, objectAcl3 });
UIRepositoryObjectAcls repositoryObjectAcls = new UIRepositoryObjectAcls();
repositoryObjectAcls.setObjectAcl(new RepositoryObjectAcl(new RepositoryObjectRecipient(RECIPIENT1, Type.USER)));
assertFalse(repositoryObjectAcls.isModelDirty());
assertFalse(repositoryObjectAcls.isRemoveEnabled());
assertFalse(repositoryObjectAcls.hasManageAclAccess());
assertTrue(repositoryObjectAcls.isEntriesInheriting());
repositoryObjectAcls.addAcls(originalUIAcls);
assertTrue(repositoryObjectAcls.isModelDirty());
assertTrue(repositoryObjectAcls.isEntriesInheriting());
assertFalse(repositoryObjectAcls.isRemoveEnabled());
repositoryObjectAcls.setRemoveEnabled(true);
assertTrue(repositoryObjectAcls.isRemoveEnabled());
repositoryObjectAcls.setModelDirty(true);
assertTrue(repositoryObjectAcls.isModelDirty());
assertTrue(repositoryObjectAcls.isRemoveEnabled());
assertTrue(repositoryObjectAcls.isEntriesInheriting());
repositoryObjectAcls.setModelDirty(false);
assertFalse(repositoryObjectAcls.isModelDirty());
assertTrue(repositoryObjectAcls.isEntriesInheriting());
repositoryObjectAcls.setEntriesInheriting(true);
assertFalse(repositoryObjectAcls.isModelDirty());
assertTrue(repositoryObjectAcls.isEntriesInheriting());
repositoryObjectAcls.setEntriesInheriting(false);
assertTrue(repositoryObjectAcls.isModelDirty());
assertFalse(repositoryObjectAcls.isRemoveEnabled());
assertFalse(repositoryObjectAcls.isEntriesInheriting());
repositoryObjectAcls.setHasManageAclAccess(true);
assertTrue(repositoryObjectAcls.hasManageAclAccess());
}
Aggregations