sym.sdk.request_permission¶
Models for defining permissions required to view or perform actions on Requests.
Classes
Represent basic Request permission categories in the Sym platform. |
|
A class representing permissions required to view or act on Requests. |
- class sym.sdk.request_permission.PermissionLevel(value)¶
-
Represent basic Request permission categories in the Sym platform.
PermissionLevels are defined in descending order of permissions. Each permission level includes all permission levels below it.
- ADMIN = 'admin'¶
Permissions are applied to admins only. Admins are allowed to do anything. (e.g. Use symflow CLI, run Flows, apply Terraform).
- ALL_USERS = 'all_users'¶
Permissions are applied to all users (admins, members and guests). Guests can approve/deny/revoke Requests, if the Flow is configured to allow guest interactions.
- MEMBER = 'member'¶
Permissions are applied to admins and members only. Members can run Flows and interact with Requests.
- pydantic model sym.sdk.request_permission.RequestPermission¶
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.
Show JSON schema
{ "title": "RequestPermission", "description": "A class representing permissions required to view or act on Requests. If no permissions are specified, then admin permission is implied.", "type": "object", "properties": { "webapp_view": { "title": "Webapp View", "anyOf": [ { "$ref": "#/definitions/PermissionLevel" }, { "type": "array", "items": { "type": "string", "format": "uuid" } } ] }, "approve_deny": { "title": "Approve Deny", "anyOf": [ { "$ref": "#/definitions/PermissionLevel" }, { "type": "array", "items": { "type": "string", "format": "uuid" } } ] }, "allow_self_approval": { "title": "Allow Self Approval", "default": false, "type": "boolean" } }, "required": [ "webapp_view", "approve_deny" ], "definitions": { "PermissionLevel": { "title": "PermissionLevel", "description": "Represent basic Request permission categories in the Sym platform.\n\nPermissionLevels are defined in descending order of permissions. Each permission level includes all permission\nlevels below it.", "enum": [ "admin", "member", "all_users" ], "type": "string" } } }
- Fields
- Validators
- 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] usinguser_ids()
.- Validated by
- 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] usinguser_ids()
.- Validated by
- validator validate_list_of_uuids » approve_deny, webapp_view¶
Validate that the
webapp_view
andapprove_deny
fields are an expected value and type.- Parameters
value – Value passed to
webapp_view
orapprove_deny
.- Returns
A list of User IDs or PermissionLevel.
- Raises
ValueError – If validation is unsuccessful.