Provision django instances with usergroups and permissions
Project description
This package works like the standard Django loaddata / dumpdata commands only it’s used for creating auth.Group objects with their provided permissions.
Requirements
Python >= 3.6
Django >= 1.11
Installation
pip install django_perms_provisioner
Then the only thing left before you can start using the Django Permissions Provisioner is adding it to you installed apps.
INSTALLED_APPS = [
"django_perms_provisioner",
]
Configuration
Configuration can either be done via providing a YAML or JSON file. Your file needs to have one of the following extensions: .json, .yaml, .yml, and their approriate contents of course.
Examples:
---
groups:
- name: Group Name
permissions:
sites:
- site.add_site
- site.change_site
wagtailadmin:
- admin.access_admin
{
"groups" [{
"name": "Group Name",
"permissions": {
"sites": ["site.add_site", "site.change_site"],
"wagtailadmin": ["admin.access_admin"]
}
}]
}
It is also possible to only create groups this can be done by just leaving out the permissions.
Example:
---
groups:
- name: Group Name
- name: Next Group Name
Usage
To load permissions from a configuration file
./manage.py loadperms permissions.yaml
Or to dump permissions to a configuration file
./manage.py dumpperms > permissions.yaml
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
Built Distribution
File details
Details for the file django-perms-provisioner-0.0.4.tar.gz
.
File metadata
- Download URL: django-perms-provisioner-0.0.4.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ceb6090996bd55b4f04fe7bb2c7acf5db36ee1f5a667b9db09e939c6f4ae59a7 |
|
MD5 | 8c460cf65590a59a50185781c91aa70f |
|
BLAKE2b-256 | 079fad940af618240dd467c159e224611ad1b93a324c8df6d690282b2200967a |
File details
Details for the file django_perms_provisioner-0.0.4-py2.py3-none-any.whl
.
File metadata
- Download URL: django_perms_provisioner-0.0.4-py2.py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c7ac75bb938286daf815a6d6d7b6966fb0df5c31be0754919b74a5e8d9db2c1 |
|
MD5 | ee3d8f6fda8b70c33e71c2577fa6717a |
|
BLAKE2b-256 | bb81f49da8e6d6a8636aac73eee881a9be09cd22189025a6a8f9b11c4082b3f7 |