Django-Rest-Framework RBAC plus
Based on the django USER model, a permission system based on RBAC mode is implemented, which provides a background admin entry mechanism for permission, and implements permission control with drf middleware.
Requirements
- Python (3.5, 3.6, 3.7, 3.8)
- Django (2.1, 2.2, 3.0)
I highly recommend and only officially support the latest patch release of each Python and Django series.
Installation
Install using pip...
pip install drf-rbac-plus
Add 'drf_rbac' to your INSTALLED_APPS setting.
INSTALLED_APPS = [
...
'drf_rbac',
]
Add path to your URL setting.
urlpatterns = [
...
path('drf_rbac/', include('drf_rbac.urls')),
]
Add UserRolePermission to your DEFAULT_PERMISSION_CLASSES(django-restframework setting).
'DEFAULT_PERMISSION_CLASSES': (
...
'drf_rbac.authorization.UserRolePermission',
),
Example
RegexValidator
These validators can be used to customized regex, the value must be match the 'word'(r"^[a-zA-Z\u4e00-\u9fa5]+$")
aa
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file drf-rbac-plus-1.3.1.tar.gz.
File metadata
- Download URL: drf-rbac-plus-1.3.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.25.0 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3055137af0cb7dac67cd1a64ec6ee7233f31aac4b5f808ac6558545f51280b62
|
|
| MD5 |
aafa08b8291c3c7da7c15e9630214bd0
|
|
| BLAKE2b-256 |
b04cc9f2e15e350c1adb670490143e0123eb9547d2e55bfba0111eb582143cb1
|