Search in sources :

Example 1 with ACTAccessApproval

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());
}
Also used : ACTAccessApproval(org.sagebionetworks.repo.model.ACTAccessApproval) Test(org.junit.Test)

Example 2 with ACTAccessApproval

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;
}
Also used : ACTAccessApproval(org.sagebionetworks.repo.model.ACTAccessApproval)

Example 3 with ACTAccessApproval

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());
}
Also used : ACTAccessApproval(org.sagebionetworks.repo.model.ACTAccessApproval) Test(org.junit.Test)

Example 4 with ACTAccessApproval

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);
}
Also used : ACTAccessApproval(org.sagebionetworks.repo.model.ACTAccessApproval) Test(org.junit.Test)

Aggregations

ACTAccessApproval (org.sagebionetworks.repo.model.ACTAccessApproval)4 Test (org.junit.Test)3