---
url: "https://vueda.dev/v3/reference/api/py/vueda.core.permissions/DynamicObjectPermissions.md"
title: "DynamicObjectPermissions"
---

# DynamicObjectPermissions

## Overview

CRUD permissions for endpoints that select their model from ``app_label`` and ``model``.

``crudl_perms_map`` names the CRUD action for each HTTP method, and
``get_required_permissions`` resolves that action through ``PERMISSION_NAMES_MAPPING`` when
the check runs. An installation that renames an action is therefore honoured without patching
this class at import.

``PATCH`` requires read rather than update. These endpoints do not edit ordinary model fields.
They act on data the target object owns, and each endpoint applies its own further gates.

## `get_required_object_permissions` {#get_required_object_permissions}

Object permissions match the model permissions the same method requires.

### Signature {#get_required_object_permissions-signature}

`get_required_object_permissions(self, method, model_cls)`

#### Parameters {#get_required_object_permissions-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="get_required_object_permissions-param-method">method</span> |  | yes |  |  |
| <span id="get_required_object_permissions-param-model_cls">model_cls</span> |  | yes |  |  |

#### Returns {#get_required_object_permissions-returns}

`list[str]`

### Source {#get_required_object_permissions-source}

`server/vueda/core/permissions.py:262`

## `get_required_permissions` {#get_required_permissions}

Return the permissions ``method`` needs on ``model_cls``, named as this installation names them.

### Signature {#get_required_permissions-signature}

`get_required_permissions(self, method, model_cls)`

#### Parameters {#get_required_permissions-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="get_required_permissions-param-method">method</span> |  | yes |  |  |
| <span id="get_required_permissions-param-model_cls">model_cls</span> |  | yes |  |  |

#### Returns {#get_required_permissions-returns}

`list[str]`

### Source {#get_required_permissions-source}

`server/vueda/core/permissions.py:248`

## `has_object_permission` {#has_object_permission}

Report a failed object check as a denial rather than as a missing object.

These endpoints address an object the caller already named in the URL, so DRF's
safe-method 404 would hide the reason without hiding the object.

### Signature {#has_object_permission-signature}

`has_object_permission(self, request, view, obj)`

#### Parameters {#has_object_permission-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="has_object_permission-param-request">request</span> |  | yes |  |  |
| <span id="has_object_permission-param-view">view</span> |  | yes |  |  |
| <span id="has_object_permission-param-obj">obj</span> |  | yes |  |  |

#### Returns {#has_object_permission-returns}

`bool`

### Source {#has_object_permission-source}

`server/vueda/core/permissions.py:280`

## `has_permission` {#has_permission}

Defer a model-level denial only when the view resolves a concrete object.

A view says so through ``resolves_object``. Its ``get_object`` then checks that object,
which is where a matching state grant or deny settles the request.

### Signature {#has_permission-signature}

`has_permission(self, request, view)`

#### Parameters {#has_permission-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="has_permission-param-request">request</span> |  | yes |  |  |
| <span id="has_permission-param-view">view</span> |  | yes |  |  |

#### Returns {#has_permission-returns}

`bool`

### Source {#has_permission-source}

`server/vueda/core/permissions.py:266`

## `crudl_perms_map` {#crudl_perms_map}

## Source

`server/vueda/core/permissions.py:213`
