use of org.keycloak.representations.idm.ManagementPermissionRepresentation in project keycloak by keycloak.
the class UsersTest method createGroupWithPermissions.
private GroupRepresentation createGroupWithPermissions(String name) {
GroupRepresentation grp = new GroupRepresentation();
grp.setName(name);
realm.groups().add(grp);
Optional<GroupRepresentation> optional = realm.groups().groups().stream().filter(g -> g.getName().equals(name)).findFirst();
assertThat(optional.isPresent(), is(true));
grp = optional.get();
String id = grp.getId();
// enable the permissions
realm.groups().group(id).setPermissions(new ManagementPermissionRepresentation(true));
assertThat(realm.groups().group(id).getPermissions().isEnabled(), is(true));
return grp;
}
Aggregations