Make django router with role permission
Project description
django-role-router is a simply, definition designed router with multi-roles.
You can install it with pip. >pip install django-role-router
To use it, make sure you have installed django-role-router already.
Insert middleware jhvar.django.urls.middleware.JvRoleMiddleware after SessionMiddleware.
You can define app role permission like “permitted_roles = [‘admin’]” in urls.py global section.
You can define path role permission like “jv_path(‘admin’, views.my_admin, name=’my_admin’, roles=[‘admin’])” in urlpatterns list.
We have supported regex format with “jv_re_path” function, just like “jv_path”.
Now, you have role permission verifier, you should add your role granty in somewhere.
It just like “grant_roles(request, ‘admin’)” or “grant_roles(request, (‘admin’, ‘super’))” or “grant_roles(request, [‘admin’, ‘super’])”.
Join it, have fun.
For more detail, visit https://github.com/jhvar/django-utils.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-role-router-0.1.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1804164142dcf7d87f12f06950afe8621fc426c60c61bfa61acf1cec45587c0c |
|
MD5 | a386c8c88816e466ea43ca750ff72536 |
|
BLAKE2b-256 | c05f361e093640b1842b33ff3b232da2cede734f47dac88a51f758baf61bb9cd |
Hashes for django_role_router-0.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a16f3fdec1d6c6c1af2203b7a04e4236028aa5f668f01d669b0a67035c7d27b5 |
|
MD5 | 929a136451ee6d3b8f2eb2414820a66f |
|
BLAKE2b-256 | d4425df20e638e6762e51000e5a79af68d8f973dbc655f2b5b148ff2e0e827bd |