Permissions
- class BasePermission[source]
Base permission class
Notes
You should extend this class and override the has_permission method to create your own permission class.
- async has_permission (scope, consumer, action, **kwargs)
- async can_connect(scope, consumer, message=None)[source]
Called during connection to validate if a given client can establish a websocket connection.
By default, this returns True and permits all connections to be made.
- Parameters:
scope (Dict[str, Any]) –
consumer (AsyncConsumer) –
- Return type:
bool
- class WrappedDRFPermission(permission)[source]
Used to wrap an instance of DRF permissions class.
- Parameters:
permission (BasePermission) –
- async can_connect(scope, consumer, message=None)[source]
Called during connection to validate if a given client can establish a websocket connection.
By default, this returns True and permits all connections to be made.
- Parameters:
scope (Dict[str, Any]) –
consumer (AsyncConsumer) –
- Return type:
bool