Skip to main content

Field level permissions for Django REST Framework

Project description

New permissions possibilities for rest-framework

Compatibility

Works with :

  • Python 2.7 / Python 3.4

  • Django >= 1.6

  • Django Rest Framework >= 3.0

https://travis-ci.org/unistra/django-rest-framework-fine-permissions.svg?branch=drf3 https://coveralls.io/repos/unistra/django-rest-framework-fine-permissions/badge.png?branch=drf3 https://landscape.io/github/unistra/django-rest-framework-fine-permissions/master/landscape.svg?style=flat

Installation

Install the package from pypi:

pip install djangorestframework-fine-permissions

Add the application in your django settings:

DJANGO_APPS = ('rest_framework_fine_permissions',)

Sync the django’s database:

python manage.py syncdb

Configure your rest framework :

REST_FRAMEWORK = {
    'DEFAULT_FILTER_BACKENDS': (
        # Enable the filter permission backend for all GenericAPIView
        'rest_framework_fine_permissions.filters.FilterPermissionBackend',
    ),

    'DEFAULT_PERMISSION_CLASSES': (
        # Enable the django model permissions (view,create,delete,modify)
        'rest_framework_fine_permissions.permissions.FullDjangoModelPermissions',
        # OPTIONAL if you use FilterPermissionBackend and GenericAPIView. Check filter permissions for objects.
        'rest_framework_fine_permissions.permissions.FilterPermission',
    )
}

Usage

  • Go to the django admin page

  • Add field’s permissions to a user with the “User fields permissions” link

  • Add filter’s permissions to a user with the “User filters permissions” link

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

File details

Details for the file djangorestframework-fine-permissions-0.5.1.tar.gz.

File metadata

File hashes

Hashes for djangorestframework-fine-permissions-0.5.1.tar.gz
Algorithm Hash digest
SHA256 193ecab0302843dae0631da771d047b7fed3863b278d3c54c1c79992f7d8865f
MD5 456958e1204776d2ca27c0d2a17130c6
BLAKE2b-256 008b95206449a7f90a992f87d554666eeb955109aae66c8fd19ed90430ac04b6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page