use of gemma.gsec.acl.domain.AclObjectIdentity in project Gemma by PavlidisLab.
the class AclAdviceTest method testExpressionExperimentAcls.
/*
* Test of EE ACLs and also SecurityNotInherited on EE set.
*/
@Test
public void testExpressionExperimentAcls() {
ExpressionExperiment ee = this.getTestPersistentCompleteExpressionExperiment(false);
aclTestUtils.checkEEAcls(ee);
/*
* Make public, and then add a factor and factorvalue.
*/
securityService.makePublic(ee);
ExperimentalFactor ef = ExperimentalFactor.Factory.newInstance();
VocabCharacteristic cat = VocabCharacteristic.Factory.newInstance();
cat.setCategory("foo");
cat.setCategoryUri("bar");
ef.setName("TESTING ACLS");
ef.setCategory(cat);
ef.setType(FactorType.CATEGORICAL);
ef = expressionExperimentService.addFactor(ee, ef);
FactorValue fv = FactorValue.Factory.newInstance(ef);
fv.setValue("ack");
fv = FactorValue.Factory.newInstance(ef);
fv.setValue("adddck");
expressionExperimentService.addFactorValue(ee, fv);
securityService.makePrivate(ee);
aclTestUtils.checkEEAcls(ee);
/*
* Now associate with ee set, remove the set and then the ee, make sure things are done correctly!
*/
ExpressionExperimentSet ees = ExpressionExperimentSet.Factory.newInstance();
ees.getExperiments().add(ee);
ees.setName(this.randomName());
persisterHelper.persist(ees);
// make sure the ACL for objects are there (throws an exception if not).
Acl eeacl = aclService.readAclById(new AclObjectIdentity(ee));
aclService.readAclById(new AclObjectIdentity(ees));
assertNull(eeacl.getParentAcl());
expressionExperimentSetService.remove(ees);
// make sure ACL for ees is gone
aclTestUtils.checkDeletedAcl(ees);
// make sure the ACL for ee is still there
aclTestUtils.checkHasAcl(ee);
expressionExperimentService.remove(ee);
aclTestUtils.checkDeleteEEAcls(ee);
}
use of gemma.gsec.acl.domain.AclObjectIdentity in project Gemma by PavlidisLab.
the class AclTestUtils method checkHasAcl.
public void checkHasAcl(Object f) {
try {
aclService.readAclById(new AclObjectIdentity(f));
AclTestUtils.log.debug("Have acl for " + f);
} catch (NotFoundException okaye) {
fail("Failed to create ACL for " + f);
}
}
use of gemma.gsec.acl.domain.AclObjectIdentity in project Gemma by PavlidisLab.
the class AclTestUtils method checkLacksAcl.
public void checkLacksAcl(Object f) {
try {
aclService.readAclById(new AclObjectIdentity(f));
fail("Should not have found an ACL");
} catch (NotFoundException okaye) {
// good
}
}
Aggregations