use of org.apereo.portal.groups.pags.TestGroup in project uPortal by Jasig.
the class EntityPersonAttributesGroupStore method initGroupDef.
private PagsGroup initGroupDef(IPersonAttributesGroupDefinition group) {
Element element = this.pagsGroupCache.get(group.getName());
if (element != null) {
return (PagsGroup) element.getObjectValue();
}
PagsGroup groupDef = new PagsGroup();
groupDef.setKey(group.getName());
groupDef.setName(group.getName());
groupDef.setDescription(group.getDescription());
addMemberKeys(groupDef, group.getMembers());
Set<IPersonAttributesGroupTestGroupDefinition> testGroups = group.getTestGroups();
for (IPersonAttributesGroupTestGroupDefinition testGroup : testGroups) {
TestGroup tg = new TestGroup();
Set<IPersonAttributesGroupTestDefinition> tests = testGroup.getTests();
for (IPersonAttributesGroupTestDefinition test : tests) {
IPersonTester testerInst = initializeTester(test);
if (testerInst == null) {
/*
* A tester was intended that we cannot now recreate. This
* is a potentially dangerous situation, since tests in PAGS
* are "or-ed" together; a functioning group with a missing
* test would have a wider membership, not narrower. (And
* remember -- permissions are tied to groups.) We need to
* play it safe and keep this group out of the mix.
*/
return null;
}
tg.addTest(testerInst);
}
groupDef.addTestGroup(tg);
}
element = new Element(group.getName(), groupDef);
this.pagsGroupCache.put(element);
return groupDef;
}
Aggregations