use of org.sagebionetworks.repo.model.ACTAccessApproval in project Synapse-Repository-Services by Sage-Bionetworks.
the class AccessApprovalManagerImplAutoWiredTest method testGiveACTApproval.
// it's OK for an administrator of the resource to give ACT approval
@Test
public void testGiveACTApproval() throws Exception {
actAr = newACTAccessRequirement(entityId);
actAr = accessRequirementManager.createAccessRequirement(adminUserInfo, actAr);
ACTAccessApproval actAa = newACTAccessApproval(actAr.getId(), testUserProvider.getTestUserInfo().getIndividualGroup().getId());
actAa = accessApprovalManager.createAccessApproval(adminUserInfo, actAa);
assertNotNull(actAa.getId());
}
use of org.sagebionetworks.repo.model.ACTAccessApproval in project Synapse-Repository-Services by Sage-Bionetworks.
the class AccessApprovalManagerImplAutoWiredTest method newACTAccessApproval.
private static ACTAccessApproval newACTAccessApproval(Long requirementId, String accessorId) {
ACTAccessApproval aa = new ACTAccessApproval();
aa.setAccessorId(accessorId);
aa.setEntityType(aa.getClass().getName());
aa.setRequirementId(requirementId);
aa.setApprovalStatus(ACTApprovalStatus.APPROVED);
return aa;
}
use of org.sagebionetworks.repo.model.ACTAccessApproval in project Synapse-Repository-Services by Sage-Bionetworks.
the class AccessApprovalManagerImplAutoWiredTest method testGiveACTApprovalForbidden.
// it's not ok for a non-admin to give ACT approval (in this case for themselves)
@Test(expected = ForbiddenException.class)
public void testGiveACTApprovalForbidden() throws Exception {
actAr = newACTAccessRequirement(entityId);
actAr = accessRequirementManager.createAccessRequirement(adminUserInfo, actAr);
ACTAccessApproval actAa = newACTAccessApproval(actAr.getId(), testUserProvider.getTestUserInfo().getIndividualGroup().getId());
actAa = accessApprovalManager.createAccessApproval(testUserProvider.getTestUserInfo(), actAa);
assertNotNull(actAa.getId());
}
use of org.sagebionetworks.repo.model.ACTAccessApproval in project Synapse-Repository-Services by Sage-Bionetworks.
the class AccessApprovalManagerImplAutoWiredTest method testCreateAccessApprovalBadParam4.
// can't apply an ACTAccessApproval to a TermsOfUse requirement
@Test(expected = InvalidModelException.class)
public void testCreateAccessApprovalBadParam4() throws Exception {
ACTAccessApproval aa = newACTAccessApproval(ar.getId(), adminUserInfo.getIndividualGroup().getId());
aa = accessApprovalManager.createAccessApproval(adminUserInfo, aa);
}
Aggregations