ObjectPermissions
Overview
Extends DjangoObjectPermissions to support state permissions and CRUDL naming conventions. It sets the 'view_action' in permission checks to determine required permissions for views and objects based on the current action in the view.
_has_later_permission_decision
Return whether this action has a guaranteed state-aware decision after model scope.
Signature
_has_later_permission_decision(self, view)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| self | yes | ||
| view | yes |
Returns
<class 'bool'>
Source
server/vueda/core/permissions.py:78
get_required_object_permissions
Allow dynamic permissions based on the view action, for callables in perms_map, for object permissions.
Signature
get_required_object_permissions(self, method, model_cls)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| self | yes | ||
| method | yes | ||
| model_cls | yes |
Returns
list[str]
Source
server/vueda/core/permissions.py:121
get_required_permissions
Allow dynamic permissions based on the view action, for callables in perms_map.
Signature
get_required_permissions(self, method, model_cls)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| self | yes | ||
| method | yes | ||
| model_cls | yes |
Returns
list[str]
Source
server/vueda/core/permissions.py:109
has_object_permission
Records the current view action then delegates to DjangoObjectPermissions.
Signature
has_object_permission(self, request, view, obj)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| self | yes | ||
| request | yes | ||
| view | yes | ||
| obj | yes |
Returns
<class 'bool'>
Source
server/vueda/core/permissions.py:103
has_permission
Defer a model-level denial only when a matching state grant can be decided later.
Object-scoped actions defer to has_object_permission. Framework list actions defer to their workflow-aware queryset filter. Collection writes, including create, retain the model-level result because no existing object supplies a workflow state.
Signature
has_permission(self, request, view)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| self | yes | ||
| request | yes | ||
| view | yes |
Returns
<class 'bool'>
Source
server/vueda/core/permissions.py:87
object_permission_actions
perms_map
view_action
Source
server/vueda/core/permissions.py:59