Search in sources :

Example 6 with ResourcePermissionsResource

use of org.keycloak.admin.client.resource.ResourcePermissionsResource in project keycloak by keycloak.

the class AbstractServletPolicyEnforcerTest method updatePermissionPolicies.

private void updatePermissionPolicies(String permissionName, String... policyNames) {
    ResourcePermissionsResource permissions = getAuthorizationResource().permissions().resource();
    ResourcePermissionRepresentation permission = permissions.findByName(permissionName);
    permission.addPolicy(policyNames);
    permissions.findById(permission.getId()).update(permission);
}
Also used : ResourcePermissionsResource(org.keycloak.admin.client.resource.ResourcePermissionsResource) ResourcePermissionRepresentation(org.keycloak.representations.idm.authorization.ResourcePermissionRepresentation)

Aggregations

ResourcePermissionsResource (org.keycloak.admin.client.resource.ResourcePermissionsResource)6 ResourcePermissionRepresentation (org.keycloak.representations.idm.authorization.ResourcePermissionRepresentation)6 Test (org.junit.Test)4 Response (javax.ws.rs.core.Response)3 AuthorizationResource (org.keycloak.admin.client.resource.AuthorizationResource)3 ResourcePermissionResource (org.keycloak.admin.client.resource.ResourcePermissionResource)3 NotFoundException (javax.ws.rs.NotFoundException)1 ResourcePermission (org.keycloak.testsuite.console.page.clients.authorization.permission.ResourcePermission)1