use of com.yahoo.athenz.zpe.AuthZpeClient.AccessCheckStatus in project athenz by yahoo.
the class TestAuthZpe method testWildcardManagePondsKernAllowed.
@Test
public void testWildcardManagePondsKernAllowed() {
String action = "manage";
String angResource = "angler:pondsKernCounty";
List<String> roles = new ArrayList<>();
roles.add("managerkernco");
// 1000 sec expiry
RoleToken rtoken = createRoleToken("angler", roles, "0", 1000);
StringBuilder roleName = new StringBuilder(256);
AccessCheckStatus status = AuthZpeClient.allowAccess(rtoken, angResource, action, roleName);
// Ventura county manager is allowed to manage Kern county ponds
Assert.assertEquals(status, AccessCheckStatus.ALLOW);
Assert.assertEquals(roleName.toString(), "manager*");
}
Aggregations