public class MapPermissionTicketStore extends Object implements PermissionTicketStore
| Constructor and Description |
|---|
MapPermissionTicketStore(KeycloakSession session,
MapStorage<MapPermissionTicketEntity,PermissionTicket> permissionTicketStore,
AuthorizationProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
long |
count(Map<PermissionTicket.FilterOption,String> attributes,
String resourceServerId)
Returns count of
PermissionTicket, filtered by the given attributes. |
PermissionTicket |
create(String resourceId,
String scopeId,
String requester,
ResourceServer resourceServer)
Creates a new
PermissionTicket instance. |
void |
delete(String id)
Deletes a permission from the underlying persistence mechanism.
|
List<PermissionTicket> |
find(Map<PermissionTicket.FilterOption,String> attributes,
String resourceServerId,
int firstResult,
int maxResult)
Returns a list of
PermissionTicket, filtered by the given attributes. |
PermissionTicket |
findById(String id,
String resourceServerId)
Returns a
PermissionTicket with the given id |
List<PermissionTicket> |
findByOwner(String owner,
String resourceServerId)
Returns a list of
PermissionTicket associated with the given owner. |
List<PermissionTicket> |
findByResource(String resourceId,
String resourceServerId)
Returns a list of
PermissionTicket associated with a org.keycloak.authorization.core.model.Resource with the given resourceId. |
List<PermissionTicket> |
findByResourceServer(String resourceServerId)
Returns a list of
PermissionTicket associated with a ResourceServer with the given resourceServerId. |
List<PermissionTicket> |
findByScope(String scopeId,
String resourceServerId)
Returns a list of
PermissionTicket associated with a org.keycloak.authorization.core.model.Scope with the given scopeId. |
List<PermissionTicket> |
findGranted(String userId,
String resourceServerId)
Returns a list of
PermissionTicket granted to the given userId. |
List<PermissionTicket> |
findGranted(String resourceName,
String userId,
String resourceServerId)
|
List<Resource> |
findGrantedOwnerResources(String owner,
int first,
int max)
Returns a list of
Resource granted by the owner to other users |
List<Resource> |
findGrantedResources(String requester,
String name,
int first,
int max)
Returns a list of
Resource granted to the given requester |
public MapPermissionTicketStore(KeycloakSession session, MapStorage<MapPermissionTicketEntity,PermissionTicket> permissionTicketStore, AuthorizationProvider provider)
public long count(Map<PermissionTicket.FilterOption,String> attributes, String resourceServerId)
PermissionTicketStorePermissionTicket, filtered by the given attributes.count in interface PermissionTicketStoreattributes - permission tickets that do not match the attributes are not included with the count; possible filter options are given by PermissionTicket.FilterOptionresourceServerId - the resource server idpublic PermissionTicket create(String resourceId, String scopeId, String requester, ResourceServer resourceServer)
PermissionTicketStorePermissionTicket instance.create in interface PermissionTicketStoreresourceServer - the resource server to which this policy belongsPermissionTicketpublic void delete(String id)
PermissionTicketStoredelete in interface PermissionTicketStoreid - the id of the policy to deletepublic PermissionTicket findById(String id, String resourceServerId)
PermissionTicketStorePermissionTicket with the given idfindById in interface PermissionTicketStoreid - the identifier of the permissionresourceServerId - the resource server idpublic List<PermissionTicket> findByResourceServer(String resourceServerId)
PermissionTicketStorePermissionTicket associated with a ResourceServer with the given resourceServerId.findByResourceServer in interface PermissionTicketStoreresourceServerId - the identifier of a resource serverpublic List<PermissionTicket> findByOwner(String owner, String resourceServerId)
PermissionTicketStorePermissionTicket associated with the given owner.findByOwner in interface PermissionTicketStoreowner - the identifier of a resource serverpublic List<PermissionTicket> findByResource(String resourceId, String resourceServerId)
PermissionTicketStorePermissionTicket associated with a org.keycloak.authorization.core.model.Resource with the given resourceId.findByResource in interface PermissionTicketStoreresourceId - the identifier of a resourceresourceServerId - the resource server idpublic List<PermissionTicket> findByScope(String scopeId, String resourceServerId)
PermissionTicketStorePermissionTicket associated with a org.keycloak.authorization.core.model.Scope with the given scopeId.findByScope in interface PermissionTicketStorescopeId - the id of the scopesresourceServerId - the resource server idpublic List<PermissionTicket> find(Map<PermissionTicket.FilterOption,String> attributes, String resourceServerId, int firstResult, int maxResult)
PermissionTicketStorePermissionTicket, filtered by the given attributes.find in interface PermissionTicketStoreattributes - a map of keys and values to filter on; possible filter options are given by PermissionTicket.FilterOptionresourceServerId - an id of resource server that resulting tickets should belong to. Ignored if nullfirstResult - first result to return; Ignored if negative or zeromaxResult - maximum number of results to return; Ignored if negativepublic List<PermissionTicket> findGranted(String userId, String resourceServerId)
PermissionTicketStorePermissionTicket granted to the given userId.findGranted in interface PermissionTicketStoreuserId - the user idresourceServerId - the resource server idpublic List<PermissionTicket> findGranted(String resourceName, String userId, String resourceServerId)
PermissionTicketStorefindGranted in interface PermissionTicketStoreresourceName - the name of a resourceuserId - the user idresourceServerId - the resource server idpublic List<Resource> findGrantedResources(String requester, String name, int first, int max)
PermissionTicketStoreResource granted to the given requesterfindGrantedResources in interface PermissionTicketStorerequester - the requestername - the keyword to query resources by name or null if any resourcefirst - first resultmax - max resultResource granted to the given requesterpublic List<Resource> findGrantedOwnerResources(String owner, int first, int max)
PermissionTicketStoreResource granted by the owner to other usersfindGrantedOwnerResources in interface PermissionTicketStoreowner - the ownerfirst - first resultmax - max resultResource granted by the ownerCopyright © 2021 JBoss by Red Hat. All rights reserved.