django-force-disable-permissions-admin
Force disable permissions in admin site.
Install
pip install django-force-disable-permissions-admin
Usage
pro/settings.py
INSTALLED_APPS = [
...
'django_force_disable_permissions_admin',
...
]
app/admin.py
from django.contrib import admin
from .models import Category
from .models import Book
from django_force_disable_permissions_admin.admin import DjagnoForceDisablePermissionsAdminMixin
class BookInline(admin.TabularInline):
model = Book
class CategoryAdmin(DjagnoForceDisablePermissionsAdminMixin, admin.ModelAdmin):
add_permission_enable_for_superuser = False
delete_permission_enable_for_superuser = False
change_permission_enable_for_superuser = False
view_permission_enable_for_superuser = False
force_disable_add_permission = True
force_disable_delete_permission = True
force_disable_change_permission = True
force_disable_view_permission = False
list_display = ["name"]
inlines = [
BookInline,
]
admin.site.register(Category, CategoryAdmin)
Control Variables
- add_permission_enable_for_superuser = False
- delete_permission_enable_for_superuser = False
- change_permission_enable_for_superuser = False
- view_permission_enable_for_superuser = False
- force_disable_add_permission = False
- force_disable_delete_permission = False
- force_disable_change_permission = False
- force_disable_view_permission = False
Note:
- By default, DjagnoForceDisablePermissionsAdminMixin doesn't change anything.
- Use the control-variabl to disable permissions.
Releases
v0.2.1 2021.05.17
- Fix has_add_permission for Django 3.x.
v0.2.0 2020.02.26
- App rename to django_force_disable_permissions_admin.
v0.1.1 2020.02.05
- Fix usage document.
v0.1.0 2020.02.05
- First release.
Metadata
Release files for django-force-disable-permissions-admin 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-force-disable-permissions-admin-0.2.1.tar.gz | 5.6 kB | Without provenance | Details for django-force-disable-permissions-admin-0.2.1.tar.gz |
Release files / django-force-disable-permissions-admin-0.2.1.tar.gz
| Download URL | django-force-disable-permissions-admin-0.2.1.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5599b3a937d6643d2f6af8a01aef283a45b30ff4fca9965a3fc82243b811ddf
|
|
BLAKE2b-256 checksum How to use checksums |
8ad1f53da5ec0bcf12fbab12feed10f1fb72b7aa468e3840c242861bb608d76a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.8
|
Security for django-force-disable-permissions-admin 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.