Very simple extension that adds a permissions check on the field in admin
Project description
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
Close
Hashes for django-admin-permissions-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a510847e9c890d5d27f6b38198c6e739df1b422ac1d4844ba408b2a5d3af1ec |
|
MD5 | 81b5f78da4b580c2cba545516a76ea3d |
|
BLAKE2b-256 | b9b1d7b6a95a7730daad08a60668059e6d8361149515e0c6bbf358171dd39b8e |