sym.sdk.request_permission.RequestPermission

class sym.sdk.request_permission.RequestPermission(*, webapp_view: Union[sym.sdk.request_permission.PermissionLevel, List[uuid.UUID]], approve_deny: Union[sym.sdk.request_permission.PermissionLevel, List[uuid.UUID]], allow_self_approval: bool = False)

Bases: pydantic.main.BaseModel

A class representing permissions required to view or act on Requests. If no permissions are specified, then admin permission is implied.

field allow_self_approval: bool = False

Whether the requester may approve their own Request.

field approve_deny: Union[sym.sdk.request_permission.PermissionLevel, List[uuid.UUID]] [Required]

Defines who is allowed to approve or deny the Request. If a PermissionLevel is provided, all users with matching permissions will be able to approve or deny the Request. If specific IDs are provided, only those users will be granted permission to approve or deny the Request. Admins can always approve or deny all Requests. Convert List[User] to List[UUID] using user_ids().

Validated by
validator validate_list_of_uuids  »  webapp_view, approve_deny

Validate that the webapp_view and approve_deny fields are an expected value and type.

Parameters

value – Value passed to webapp_view or approve_deny.

Returns

A list of User IDs or PermissionLevel.

Raises

ValueError – If validation is unsuccessful.

field webapp_view: Union[sym.sdk.request_permission.PermissionLevel, List[uuid.UUID]] [Required]

Defines who is allowed to view a Request in the web app. If a PermissionLevel is provided, all users with matching permissions will be able to view the Request. If specific IDs are provided, only those users will be granted permission to see the Request. Admins can always view all Requests. Convert List[User] to List[UUID] using user_ids().

Validated by