Skip to the content.

Code 401 Class 31 Reading Notes

DRF Permissions

Permissions determine whether a request should be granted or denied access, with authentication and throttling.

How Permissions are determined

Permissions in REST framework are always defined as a list of permission classes.

Permission checks fail, either a ‘403 Forbidden’ or a ‘401 Unauthorized’ response will be returned, according to the following rules:

Object level permissions

Setting the permission policy

AP Reference

DjangoModelPermissions

DjangoObject Permissions

DjangoModelPermissions: A permission class that ties into Django’s standard object - permissions framework that allows per-object permissions on models. In order to use this permission class, you’ll also need to add permission backend that supports object-level permissions, such as django-guardian.

Things I want to know more about

<—BACK