use of com.sun.identity.delegation.DelegationManager in project OpenAM by OpenRock.
the class RestPermissionTest method setPermission.
private void setPermission(String permissionName, boolean bAdd) throws Exception {
DelegationManager mgr = new DelegationManager(adminToken, REALM);
DelegationPrivilege dp = getDelegationPrivilege(permissionName, mgr.getPrivileges());
if (dp == null) {
dp = new DelegationPrivilege(permissionName, Collections.EMPTY_SET, REALM);
}
Set<String> subject = dp.getSubjects();
if (bAdd) {
subject.add(group.getUniversalId());
} else {
subject.remove(group.getUniversalId());
}
mgr.addPrivilege(dp);
}
Aggregations