VUEDAPermissionsMixin
Overview
Extends Django's PermissionsMixin with a multi-layer permission check:
- Django model-level permissions (via
super().has_perm). - Workflow state permissions (grant or deny based on the object's current state).
- Row-level permissions (
RowLevelPermissions.check_instance). - Workflow-aware row-level permissions (
RowLevelPermissions.check_instance_workflow), which run last and can override a state deny.
Superusers always return True and skip all checks.
Meta
Source
server/vueda/user/mixins.py:36
has_perm
Return True if the user has the specified permission. Query all available auth backends, but return immediately if any backend returns True. Thus, a user who has permission from a single auth backend is assumed to have permission in general. If an object is provided, check permissions for that object.
Signature
has_perm(self, perm, obj)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| self | yes | ||
| perm | yes | ||
| obj | django.db.models.base.Model | None | yes |
Returns
<class 'bool'>
Source
server/vueda/user/mixins.py:39
is_superuser
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Signature
is_superuser(unknown)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| unknown | yes |
_meta
groups
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example::
class Pizza(Model):
toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.
Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.
user_permissions
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example::
class Pizza(Model):
toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.
Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.
Source
server/vueda/user/mixins.py:23