Django App Permissions Access Request
UI for handling app permissions defined in the Django App Permissions package (https://github.com/amp89/django-app-permissions)
Install
pip install --upgrade django-app-permissions-access-request
Configure
NOTE: Make sure the base django stuff is migrated before adding this to the project!
settings.py
- Must have
Django App Permissions
installed and setup - In
ACCESS_CONTROLLED_INSTALLED_APPS
, adddjango_app_permissions_access_request
. IT MUST GO INACCESS CONTROLLED
INSTALLED APPS, OR ANYONE WILL BE ABLE TO CHANGE THEIR OWN PERMISSIONS! -
SITE_HOME_URL_NAME
This should be the name of the url that is the home/ root site. - [RECOMMENDED] in
settings.py
:REDIRECT_ACCESS_REQUEST_HOME = True
- this will redirect the user back to theSITE_HOME_URL_NAME
page instead of the access request list, after submitting the access request form. - [RECOMMENDED] in
settings.py
:REDIRECT_403_URL='django_app_permissions_access_request.request_access'
to direct the user to the request form - Add to base URLS:
path('access_request/', include('django_app_permissions_access_request.urls')),
Use:
The new urls are now:
access_request/approvals/
(name='django_app_permissions_access_request.approvals'
) You must be a part of this app on the backend (in the django_app_permissions_access_request
group) or a superuser with ALLOW_ALL_SUPERUSER = True
to see this page. This is where user requests are approved / denied.
access_request/
(name='django_app_permissions_access_request.request_list'
) A list of apps that the user can request
access_request/request/?group_id
(name='django_app_permissions_access_request.request_access'
) These are linked to in the above page, and if REDIRECT_403_URL='django_app_permissions_access_request.request_access'
is set in settings, the user will be directed to the request page if they try to visit an app that they are not a part of.