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

    Modifier and Type
    Method
    Description
    org.keycloak.representations.idm.authorization.UmaPermissionRepresentation
    create(org.keycloak.representations.idm.authorization.UmaPermissionRepresentation permission)
    Creates a new user-managed permission as represented by the given permission.
    void
    Deletes an existing user-managed permission
    List<org.keycloak.representations.idm.authorization.UmaPermissionRepresentation>
    find(String name, String scope, Integer firstResult, Integer maxResult)
    Queries the server for permission matching the given parameters.
    org.keycloak.representations.idm.authorization.UmaPermissionRepresentation
    Queries the server for a permission with the given id.
    void
    update(org.keycloak.representations.idm.authorization.UmaPermissionRepresentation permission)
    Updates an existing user-managed permission

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • create

      public org.keycloak.representations.idm.authorization.UmaPermissionRepresentation create(org.keycloak.representations.idm.authorization.UmaPermissionRepresentation permission)
      Creates a new user-managed permission as represented by the given permission.
      Parameters:
      permission - the permission to create
      Returns:
      if successful, the permission created
    • update

      public void update(org.keycloak.representations.idm.authorization.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<org.keycloak.representations.idm.authorization.UmaPermissionRepresentation> find(String name, String scope, Integer firstResult, Integer maxResult)
      Queries the server for permission matching the given parameters.
      Parameters:
      id - the permission id
      name - the name of the permission
      scope - the scope associated with the permission
      firstResult - the position of the first resource to retrieve
      maxResult - the maximum number of resources to retrieve
      Returns:
      the permissions matching the given parameters
    • findById

      public org.keycloak.representations.idm.authorization.UmaPermissionRepresentation findById(String id)
      Queries the server for a permission with the given id.
      Parameters:
      id - the permission id
      Returns:
      the permission with the given id