Class PolicyResource
- java.lang.Object
-
- org.keycloak.authorization.client.resource.PolicyResource
-
public class PolicyResource extends Object
An entry point for managing user-managed permissions for a particular resource- Author:
- Pedro Igor
-
-
Constructor Summary
Constructors Constructor Description PolicyResource(String resourceId, Http http, ServerConfiguration serverConfiguration, TokenCallable pat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UmaPermissionRepresentationcreate(UmaPermissionRepresentation permission)Creates a new user-managed permission as represented by the givenpermission.voiddelete(String id)Deletes an existing user-managed permissionList<UmaPermissionRepresentation>find(String name, String scope, Integer firstResult, Integer maxResult)Queries the server for permission matching the given parameters.UmaPermissionRepresentationfindById(String id)Queries the server for a permission with the givenid.voidupdate(UmaPermissionRepresentation permission)Updates an existing user-managed permission
-
-
-
Constructor Detail
-
PolicyResource
public PolicyResource(String resourceId, Http http, ServerConfiguration serverConfiguration, TokenCallable pat)
-
-
Method Detail
-
create
public UmaPermissionRepresentation create(UmaPermissionRepresentation permission)
Creates a new user-managed permission as represented by the givenpermission.- Parameters:
permission- the permission to create- Returns:
- if successful, the permission created
-
update
public void update(UmaPermissionRepresentation permission)
Updates an existing user-managed permission- Parameters:
permission- the permission to update
-
delete
public void delete(String id)
Deletes an existing user-managed permission- Parameters:
id- the permission id
-
find
public List<UmaPermissionRepresentation> find(String name, String scope, Integer firstResult, Integer maxResult)
Queries the server for permission matching the given parameters.- Parameters:
id- the permission idname- the name of the permissionscope- the scope associated with the permissionfirstResult- the position of the first resource to retrievemaxResult- the maximum number of resources to retrieve- Returns:
- the permissions matching the given parameters
-
findById
public UmaPermissionRepresentation findById(String id)
Queries the server for a permission with the givenid.- Parameters:
id- the permission id- Returns:
- the permission with the given id
-
-