protected class StoreFactoryCacheSession.PermissionTicketCache extends Object implements PermissionTicketStore
Modifier | Constructor and Description |
---|---|
protected |
PermissionTicketCache() |
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 long count(Map<PermissionTicket.FilterOption,String> attributes, String resourceServerId)
PermissionTicketStore
PermissionTicket
, filtered by the given attributes.count
in interface PermissionTicketStore
attributes
- permission tickets that do not match the attributes are not included with the count; possible filter options are given by PermissionTicket.FilterOption
resourceServerId
- the resource server idpublic PermissionTicket create(String resourceId, String scopeId, String requester, ResourceServer resourceServer)
PermissionTicketStore
PermissionTicket
instance.create
in interface PermissionTicketStore
resourceServer
- the resource server to which this policy belongsPermissionTicket
public void delete(String id)
PermissionTicketStore
delete
in interface PermissionTicketStore
id
- the id of the policy to deletepublic PermissionTicket findById(String id, String resourceServerId)
PermissionTicketStore
PermissionTicket
with the given id
findById
in interface PermissionTicketStore
id
- the identifier of the permissionresourceServerId
- the resource server idpublic List<PermissionTicket> findByResourceServer(String resourceServerId)
PermissionTicketStore
PermissionTicket
associated with a ResourceServer
with the given resourceServerId
.findByResourceServer
in interface PermissionTicketStore
resourceServerId
- the identifier of a resource serverpublic List<PermissionTicket> findByResource(String resourceId, String resourceServerId)
PermissionTicketStore
PermissionTicket
associated with a org.keycloak.authorization.core.model.Resource
with the given resourceId
.findByResource
in interface PermissionTicketStore
resourceId
- the identifier of a resourceresourceServerId
- the resource server idpublic List<PermissionTicket> findByScope(String scopeId, String resourceServerId)
PermissionTicketStore
PermissionTicket
associated with a org.keycloak.authorization.core.model.Scope
with the given scopeId
.findByScope
in interface PermissionTicketStore
scopeId
- the id of the scopesresourceServerId
- the resource server idpublic List<PermissionTicket> find(Map<PermissionTicket.FilterOption,String> attributes, String resourceServerId, int firstResult, int maxResult)
PermissionTicketStore
PermissionTicket
, filtered by the given attributes.find
in interface PermissionTicketStore
attributes
- a map of keys and values to filter on; possible filter options are given by PermissionTicket.FilterOption
resourceServerId
- an id of resource server that resulting tickets should belong to. Ignored if null
firstResult
- 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)
PermissionTicketStore
PermissionTicket
granted to the given userId
.findGranted
in interface PermissionTicketStore
userId
- the user idresourceServerId
- the resource server idpublic List<PermissionTicket> findGranted(String resourceName, String userId, String resourceServerId)
PermissionTicketStore
findGranted
in interface PermissionTicketStore
resourceName
- the name of a resourceuserId
- the user idresourceServerId
- the resource server idpublic List<Resource> findGrantedResources(String requester, String name, int first, int max)
PermissionTicketStore
Resource
granted to the given requester
findGrantedResources
in interface PermissionTicketStore
requester
- the requestername
- the keyword to query resources by name or null if any resourcefirst
- first resultmax
- max resultResource
granted to the given requester
public List<Resource> findGrantedOwnerResources(String owner, int first, int max)
PermissionTicketStore
Resource
granted by the owner to other usersfindGrantedOwnerResources
in interface PermissionTicketStore
owner
- the ownerfirst
- first resultmax
- max resultResource
granted by the ownerpublic List<PermissionTicket> findByOwner(String owner, String resourceServerId)
PermissionTicketStore
PermissionTicket
associated with the given owner
.findByOwner
in interface PermissionTicketStore
owner
- the identifier of a resource serverCopyright © 2021 JBoss by Red Hat. All rights reserved.