Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Very simple extension that adds a permissions check on the field in admin

Project description

https://travis-ci.org/silentsokolov/django-admin-permissions.png?branch=master

django-admin-permissions

Very simple extension that adds a permissions check on the field in admin

Installation

Requires

django >= 1.4

Install with pip:

Run pip install git+https://github.com/SilentSokolov/django-admin-permissions.git

Or pip install django-automatic-links

Open settings.py and add automatic_links to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'admin_permissions',
    ...
)

Example usage

Use class ModelAdminPermission and set permissions using fields_permissions:

class ArticleAdmin(ModelAdminPermission):
    fieldsets = [
        ('General', {
            'fields': ['title', 'slug', 'text'],
        }),
        ('SEO', {
            'fields': ['seo_title', 'seo_description'],
        }),
    ]

    fields_permissions = {
        # 'permission': ('field',)
        'articles.can_change_admin_seo_fields': ('seo_title', 'seo_description'),
    }

Options

If you want the user to see the field, but could not edit them, set fields_permissions_read_only is True, default False.

Project details


Release history Release notifications

This version
History Node

0.2.1

History Node

0.2

History Node

0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-admin-permissions-0.2.1.tar.gz (3.3 kB) Copy SHA256 hash SHA256 Source None Sep 9, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page