Interface PermissionTicketStore

    • Method Detail

      • delete

        void delete​(String id)
        Deletes a permission from the underlying persistence mechanism.
        Parameters:
        id - the id of the policy to delete
      • findById

        PermissionTicket findById​(String id,
                                  String resourceServerId)
        Returns a PermissionTicket with the given id
        Parameters:
        id - the identifier of the permission
        resourceServerId - the resource server id
        Returns:
        a permission with the given identifier.
      • findByResourceServer

        List<PermissionTicket> findByResourceServer​(String resourceServerId)
        Returns a list of PermissionTicket associated with a ResourceServer with the given resourceServerId.
        Parameters:
        resourceServerId - the identifier of a resource server
        Returns:
        a list of permissions belonging to the given resource server
      • findByOwner

        List<PermissionTicket> findByOwner​(String owner,
                                           String resourceServerId)
        Returns a list of PermissionTicket associated with the given owner.
        Parameters:
        owner - the identifier of a resource server
        Returns:
        a list of permissions belonging to the given owner
      • findByResource

        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.
        Parameters:
        resourceId - the identifier of a resource
        resourceServerId - the resource server id
        Returns:
        a list of permissions associated with the given resource
      • findByScope

        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.
        Parameters:
        scopeId - the id of the scopes
        resourceServerId - the resource server id
        Returns:
        a list of permissions associated with the given scopes
      • find

        List<PermissionTicket> find​(Map<PermissionTicket.FilterOption,​String> attributes,
                                    String resourceServerId,
                                    int firstResult,
                                    int maxResult)
        Returns a list of PermissionTicket, filtered by the given attributes.
        Parameters:
        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 zero
        maxResult - maximum number of results to return; Ignored if negative
        Returns:
        a list of filtered and paginated permissions
        Throws:
        IllegalArgumentException - when there is an unknown attribute in the attributes map
      • findGranted

        List<PermissionTicket> findGranted​(String userId,
                                           String resourceServerId)
        Returns a list of PermissionTicket granted to the given userId.
        Parameters:
        userId - the user id
        resourceServerId - the resource server id
        Returns:
        a list of permissions granted for a particular user
      • findGranted

        List<PermissionTicket> findGranted​(String resourceName,
                                           String userId,
                                           String resourceServerId)
        Returns a list of PermissionTicket with name equal to resourceName granted to the given userId.
        Parameters:
        resourceName - the name of a resource
        userId - the user id
        resourceServerId - the resource server id
        Returns:
        a list of permissions granted for a particular user
      • findGrantedResources

        List<Resource> findGrantedResources​(String requester,
                                            String name,
                                            int first,
                                            int max)
        Returns a list of Resource granted to the given requester
        Parameters:
        requester - the requester
        name - the keyword to query resources by name or null if any resource
        first - first result
        max - max result
        Returns:
        a list of Resource granted to the given requester
      • findGrantedOwnerResources

        List<Resource> findGrantedOwnerResources​(String owner,
                                                 int first,
                                                 int max)
        Returns a list of Resource granted by the owner to other users
        Parameters:
        owner - the owner
        first - first result
        max - max result
        Returns:
        a list of Resource granted by the owner