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).

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

django-perms-provisioner-0.0.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

django_perms_provisioner-0.0.1-py2.py3-none-any.whl (6.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-perms-provisioner-0.0.1.tar.gz.

File metadata

  • Download URL: django-perms-provisioner-0.0.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for django-perms-provisioner-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ec39742b6697e914cc3e1334c693c36ae40d86475e9e6cbf15d30001efcd19c0
MD5 d90649d287c46bb8261ae2722f413722
BLAKE2b-256 b5c62c26892c1a75ab6218eb97d2e5ed71ed7d8c26dc03f8a1c4ed826b2f759a

See more details on using hashes here.

File details

Details for the file django_perms_provisioner-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: django_perms_provisioner-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for django_perms_provisioner-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0ab812d4b6cd748ea14600dbdc06cdc1cbbea426fd848d13ee8987d22f94f1e0
MD5 dfd4a317b7d9d3a5186678730d995c75
BLAKE2b-256 ea256fefec1b10fbc4b8fad33e92f395d9dffb902bae4470ddf5872e0911be49

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page