Skip to main content

Provision django instances with usergroups and permissions

Project description

https://img.shields.io/badge/code%20style-black-000000.svg

This package works like the standard Django loaddata / dumpdata commands only it’s used for creating auth.Group objects with their provided permissions.

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",
]

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

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 a group this can be done by leaving out the permissions object (dict).

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_perms_provisioner-0.0.1-py2.py3-none-any.whl (6.3 kB) Copy SHA256 hash SHA256 Wheel py2.py3
django-perms-provisioner-0.0.1.tar.gz (15.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page