--- id: djangorestframework-guardian version: "0.4.0" license: BSD-3-Clause license_treatment: permissive maintenance: aging --- # djangorestframework-guardian — django-guardian support for Django REST Framework License: permissive · Maintenance: aging · Downloads: 160.5K/mo ## What it is and what it does djangorestframework-guardian bridges django-guardian's object-level permission system into Django REST Framework's API layer. It provides two main tools: ObjectPermissionsFilter, which restricts querysets to only objects a user has permission to view, and ObjectPermissionsAssignmentMixin, which automatically assigns permissions to users or groups when objects are created or updated via serializers. The package is designed for applications that need granular, per-object access control in REST APIs—where different users should see and modify different subsets of the same model. It requires django-guardian to be configured with its ObjectPermissionBackend and works alongside custom permission classes that map HTTP methods to specific permission names. Use it for: - Multi-tenant SaaS APIs where each user should only see and modify their own data or shared resources. - Collaborative platforms where permissions are assigned per-object to users and groups dynamically. - Admin dashboards that expose REST endpoints with row-level security based on object permissions. - Workflows where creating a resource automatically grants specific permissions to the creator and designated groups. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates django-guardian's object-level permissions into Django REST Framework, enabling fine-grained access control on API resources through filtering and automatic permission assignment. Yes, if you are building a Django REST Framework API that requires object-level permissions beyond Django's standard model-level checks. The package is stable (Production/Stable status), has no known vulnerabilities, and low install friction. However, maintenance is infrequent (409 days since last release), so verify it works with your specific Django and djangorestframework versions before committing to it in a new project. ## Install pip install djangorestframework-guardian uv add djangorestframework-guardian poetry add djangorestframework-guardian ## Installing djangorestframework-guardian Before you install: Low friction: pure Python wheel with three straightforward dependencies (django, djangorestframework, django-guardian). Last release 2025-07-01; repository active and not archived, though 409 days since last release suggests maintenance is infrequent. License in practice: BSD-3-Clause (permissive): you may use, modify, and distribute this package freely in commercial and open-source projects, provided you include the license notice. Quickstart: pip install djangorestframework-guardian from djangorestframework_guardian import filters class MyViewSet: filter_backends = [filters.ObjectPermissionsFilter] django-guardian and djangorestframework must be installed and configured in INSTALLED_APPS and AUTHENTICATION_BACKENDS before this package's filters will function. Verify before relying: - Whether ObjectPermissionsFilter works correctly with all Django REST Framework view types and pagination strategies. - Performance characteristics when filtering large querysets with many object-level permissions. - Compatibility with custom user models or non-standard permission backends. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 160.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django rest framework object permissions, django-guardian api integration, rest api per-object access control, django rest framework permission filtering, object-level permissions rest api, object-level-permissions, access-control [View on SkillFed](https://skillfed.io/packages/djangorestframework-guardian) · [View on PyPI](https://pypi.org/project/djangorestframework-guardian/)