Class PermissionResource
java.lang.Object
org.keycloak.authorization.client.resource.PermissionResource
An entry point for managing permission tickets using the Protection API.
- Author:
- Pedro Igor
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionResource(Http http, ServerConfiguration serverConfiguration, TokenCallable pat) -
Method Summary
Modifier and TypeMethodDescriptioncount(String resourceId, String scopeId, String owner, String requester, Boolean granted, Boolean returnNames) org.keycloak.representations.idm.authorization.PermissionResponseCreates a new permission ticket for a set of one or more resource and scope(s).org.keycloak.representations.idm.authorization.PermissionResponsecreate(org.keycloak.representations.idm.authorization.PermissionRequest request) Creates a new permission ticket for a single resource and scope(s).org.keycloak.representations.idm.authorization.PermissionTicketRepresentationcreate(org.keycloak.representations.idm.authorization.PermissionTicketRepresentation ticket) Creates a new uma permission for a single resource and scope(s).voidDeletes a permission ticket by ID.List<org.keycloak.representations.idm.authorization.PermissionTicketRepresentation>find(String resourceId, String scopeId, String owner, String requester, Boolean granted, Boolean returnNames, Integer firstResult, Integer maxResult) Query the server for any permission ticket with the matching arguments.List<org.keycloak.representations.idm.authorization.PermissionTicketRepresentation>findByResource(String resourceId) Query the server for any permission ticket associated with the givenresourceId.List<org.keycloak.representations.idm.authorization.PermissionTicketRepresentation>findByScope(String scopeId) Query the server for any permission ticket associated with the givenscopeId.org.keycloak.representations.idm.authorization.PermissionResponseforResource(org.keycloak.representations.idm.authorization.PermissionRequest request) Deprecated.voidupdate(org.keycloak.representations.idm.authorization.PermissionTicketRepresentation ticket) Updates a permission ticket.
-
Constructor Details
-
PermissionResource
-
-
Method Details
-
forResource
@Deprecated public org.keycloak.representations.idm.authorization.PermissionResponse forResource(org.keycloak.representations.idm.authorization.PermissionRequest request) Deprecated.- Parameters:
request-- Returns:
-
count
-
create
public org.keycloak.representations.idm.authorization.PermissionResponse create(org.keycloak.representations.idm.authorization.PermissionRequest request) Creates a new permission ticket for a single resource and scope(s).- Parameters:
request- thePermissionRequestrepresenting the resource and scope(s) (notnull)- Returns:
- a permission response holding a permission ticket with the requested permissions
-
create
public org.keycloak.representations.idm.authorization.PermissionResponse create(List<org.keycloak.representations.idm.authorization.PermissionRequest> requests) Creates a new permission ticket for a set of one or more resource and scope(s).- Parameters:
requests- thePermissionRequestrepresenting the resource and scope(s) (notnull)- Returns:
- a permission response holding a permission ticket with the requested permissions
-
create
public org.keycloak.representations.idm.authorization.PermissionTicketRepresentation create(org.keycloak.representations.idm.authorization.PermissionTicketRepresentation ticket) Creates a new uma permission for a single resource and scope(s).- Parameters:
ticket- thePermissionTicketRepresentationrepresenting the resource and scope(s) (notnull)- Returns:
- a permission response holding the permission ticket representation
-
findByScope
public List<org.keycloak.representations.idm.authorization.PermissionTicketRepresentation> findByScope(String scopeId) Query the server for any permission ticket associated with the givenscopeId.- Parameters:
scopeId- the scope id (notnull)- Returns:
- a list of permission tickets associated with the given
scopeId
-
findByResource
public List<org.keycloak.representations.idm.authorization.PermissionTicketRepresentation> findByResource(String resourceId) Query the server for any permission ticket associated with the givenresourceId.- Parameters:
resourceId- the resource id (notnull)- Returns:
- a list of permission tickets associated with the given
resourceId
-
find
public List<org.keycloak.representations.idm.authorization.PermissionTicketRepresentation> find(String resourceId, String scopeId, String owner, String requester, Boolean granted, Boolean returnNames, Integer firstResult, Integer maxResult) Query the server for any permission ticket with the matching arguments.- Parameters:
resourceId- the resource id or namescopeId- the scope id or nameowner- the owner id or namerequester- the requester id or namegranted- if true, only permission tickets marked as granted are returned.returnNames- if the response should include names for resource, scope and ownerfirstResult- the position of the first resource to retrievemaxResult- the maximum number of resources to retrieve- Returns:
- a list of permission tickets with the matching arguments
-
update
public void update(org.keycloak.representations.idm.authorization.PermissionTicketRepresentation ticket) Updates a permission ticket.- Parameters:
ticket- the permission ticket
-
delete
Deletes a permission ticket by ID.- Parameters:
ticketId- the permission ticket ID
-
create(PermissionRequest)