Authorization

This module provides access to the auth REST api of Camunda.

AuthorizationType

class pycamunda.auth.AuthorizationType

An enumeration.

global_ = 0
grant = 1
revoke = 2

Authorization

class pycamunda.auth.Authorization(id_: str, type_: pycamunda.auth.AuthorizationType, permissions: Tuple[str], user_id: str, group_id: str, resource_type: pycamunda.resource.ResourceType, resource_id: str, links: Optional[Tuple[pycamunda.resource.Link]] = None, root_process_instance_id: Optional[str] = None, removal_time: Optional[datetime.datetime] = None)

Data class of authorization as returned by the REST api of Camunda.

removal_time = None
root_process_instance_id = None

GetList

class pycamunda.auth.GetList(url: str, id_: Optional[str] = None, type_: Union[str, pycamunda.auth.AuthorizationType, None] = None, user_id_in: Optional[Iterable[str]] = None, group_id_in: Optional[Iterable[str]] = None, resource_type: Union[str, pycamunda.resource.ResourceType, None] = None, resource_id: Optional[int] = None, sort_by: Optional[str] = None, ascending: bool = True, first_result: Optional[int] = None, max_results: Optional[int] = None)

Query for a list of authorizations using a list of parameters. The size of the result set can be retrieved by using the Get Count request.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Filter by the id of the authorization.
  • type – Filter by the authorization type.
  • user_id_in – Filter whether the user id is one of multiple ones.
  • group_id_in – Filter whether the group id is one of multiple ones.
  • resource_type – Filter by the resource type.
  • resource_id – Filter by the resource id.
  • sort_by – Sort the results by id_, lock_expiration_time, `process_instance_id, process_definition_key, tenant_id or task_priority.
  • ascending – Sort order.
  • first_result – Pagination of results. Index of the first result to return.
  • max_results – Pagination of results. Maximum number of results to return.
__call__(*args, **kwargs) → Tuple[pycamunda.auth.Authorization]

Send the request.

Count

class pycamunda.auth.Count(url: str, id_: Optional[str] = None, type_: Union[str, pycamunda.auth.AuthorizationType, None] = None, user_id_in: Optional[Iterable[str]] = None, group_id_in: Optional[Iterable[str]] = None, resource_type: Union[str, pycamunda.resource.ResourceType, None] = None, resource_id: Optional[int] = None)

Get the size of the result returned by the Get List request.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Filter by the id of the authorization.
  • type – Filter by the authorization type.
  • user_id_in – Filter whether the user id is one of multiple ones.
  • group_id_in – Filter whether the group id is one of multiple ones.
  • resource_type – Filter by the resource type.
  • resource_id – Filter by the resource id.
__call__(*args, **kwargs) → int

Send the request.

Get

class pycamunda.auth.Get(url: str, id_: str)

Get an auth.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the authorization.
__call__(*args, **kwargs) → pycamunda.auth.Authorization

Send the request.

Check

class pycamunda.auth.Check(url: str, permission_name: str, permission_value: int, resource_name: str, resource_type: Union[str, pycamunda.resource.ResourceType], resource_id: Optional[str] = None)

Check the authorization of the currently authenticated user.

Parameters:
  • url – Camunda Rest engine URL.
  • permission_name – Name of the permission to check.
  • permission_value – Value of the permission to check for.
  • resource_name – Name of the resource to check for.
  • resource_type – Type of the resource to check for.
  • resource_id – Id of the resource to check for.
__call__(*args, **kwargs) → pycamunda.auth.Permission

Send the request.

Options

class pycamunda.auth.Options(url: str, id_: Optional[str] = None)

Get a list of options the currently authenticated user can perform on the authorization resource.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the authorization
__call__(*args, **kwargs) → pycamunda.resource.ResourceOptions

Send the request.

Create

class pycamunda.auth.Create(url: str, type_: Union[int, pycamunda.auth.AuthorizationType], permissions: Iterable[str], resource_type: Union[str, pycamunda.resource.ResourceType], resource_id: str, user_id: Optional[str] = None, group_id: Optional[str] = None)

Create an auth.

Parameters:
  • url – Camunda Rest engine URL.
  • type – Id of the authorization.
  • permissions – Permissions provided by this authorization. A permission be ‘READ’ or ‘CREATE’ for example.
  • user_id – Id of the user this authorization is for. The value ‘*’ means all users.
  • group_id – Id of the group this authorization is for.
  • resource_type – Resource type this authorization is for.
  • resource_id – Id of the resource. The value ‘*’ means all instances of a resource.
__call__(*args, **kwargs) → pycamunda.auth.Authorization

Send the request.

Update

class pycamunda.auth.Update(url: str, id_: str, permissions: Iterable[str], resource_type: Union[str, pycamunda.resource.ResourceType], resource_id: str, user_id: Optional[str] = None, group_id: Optional[str] = None)

Update an auth.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the authorization.
  • permissions – Permissions provided by this authorization. A permission be ‘READ’ or ‘CREATE’ for example.
  • user_id – Id of the user this authorization is for. The value ‘*’ means all users.
  • group_id – Id of the group this authorization is for.
  • resource_type – Resource type this authorization is for.
  • resource_id – Id of the resource. The value ‘*’ means all instances of a resource.
__call__(*args, **kwargs) → None

Send the request.

Delete

class pycamunda.auth.Delete(url: str, id_: str)

Delete an auth.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the authorization.
__call__(*args, **kwargs) → None

Send the request.