Skip to main content

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


Download files

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

Source Distribution

django-admin-permissions-0.2.1.tar.gz (3.3 kB view hashes)

Uploaded Source

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