Skip to content

Adjudicating operations and routines

joshua-roberts edited this page Aug 27, 2024 · 1 revision

Adjudicate a set of admin operations

AdminAdjudicationResponse resp = pdp.adjudicateAdminOperations(
    new UserContext("u1"),
    List.of(
        new OperationRequest("assign", Map.of(ASCENDANT_OPERAND, "o1", DESCENDANTS_OPERAND, List.of("oa1"))),
        new OperationRequest("assign", Map.of(ASCENDANT_OPERAND, "o1", DESCENDANTS_OPERAND, List.of("oa2")))
    )
);

Adjudicate a resource operation

ResourceAdjudicationResponse resp = pdp.adjudicateResourceOperation(new UserContext("u1"), "o1", "read");

Adjudicate an admin routine

AdminAdjudicationResponse response = pdp.adjudicateAdminRoutine(
    new UserContext("u1"), 
    new RoutineRequest(
        "routine1", 
        Map.of(
            "opnd1", "test1",
            "opnd2", "test2"
        )
    )
);