Skip to content

Glossary: Django Beyond the Basics

has_permission, has_object_permission

Also written: has_permission, has_permission(), has_object_permission

Two methods of a DRF permission class. `has_permission` runs for every request before any object is fetched, and `has_object_permission` runs once a detail view has its object (the `IsOwner` class uses it to compare the order's customer with the user).

Where the book teaches it

Related terms

BasePermission