skip to navigation
skip to content

django-admin-permissions 0.2.1

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

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.

 
File Type Py Version Uploaded on Size
django-admin-permissions-0.2.1.tar.gz (md5) Source 2014-09-09 3KB