BasePermission
Base class for permissions. All permissions should inherit from this class.
Example:
Methods:
-
has_permission
Check if the permission should be accepted.
This method should be overridden by the subclasses.
Signature:
Parameters:
-
source:
- Type
-
Any
-
info:
- Type
-
Info
-
kwargs:
- Type
-
Any
- Default
-
{}
-
-
on_unauthorized
Default error raising for permissions.
This method can be overridden to customize the error raised when the permission is not granted.
Example:
Signature:
Attributes:
-
message:
- Type
-
str | None
-
error_extensions:
- Type
-
GraphQLErrorExtensions | None
-
error_class:
- Type
-
Type[GraphQLError]
-
schema_directive:
- Type
-
object