castlecraft_engineer.authorization.permission
¶
castlecraft_engineer.authorization.permission
¶
ctx(required_permissions)
¶
Decorator to associate required permission context(s) with a handler method.
Injects 'required_permissions' (always as a list) into the keyword arguments passed to the decorated method, allowing the method's implementation to access it and perform authorization checks if needed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
required_permissions
|
Union[Permission, List[Permission]]
|
A single Permission object or a list of Permissions. |
required |