Skip to main content

rbac permission plus

Project description

Django-Rest-Framework RBAC plus

Based on the django USER model, a permission system based on RBAC mode is implemented, which provides a background admin entry mechanism for permission, and implements permission control with drf middleware.


Requirements

  • Python (3.5, 3.6, 3.7, 3.8)
  • Django (2.1, 2.2, 3.0)

I highly recommend and only officially support the latest patch release of each Python and Django series.

Installation

Install using pip...

pip install drf-rbac-plus

Add 'drf_rbac' to your INSTALLED_APPS setting.

INSTALLED_APPS = [
    ...
    'drf_rbac',
]

Add path to your URL setting.

urlpatterns = [
    ...
    path('drf_rbac/', include('drf_rbac.urls')),
]

Add UserRolePermission to your DEFAULT_PERMISSION_CLASSES(django-restframework setting).

    'DEFAULT_PERMISSION_CLASSES': (
        ...
        'drf_rbac.authorization.UserRolePermission',
    ),

Example

RegexValidator

These validators can be used to customized regex, the value must be match the 'word'(r"^[a-zA-Z\u4e00-\u9fa5]+$")

    aa

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

drf-rbac-plus-1.3.1.tar.gz (10.2 kB view hashes)

Uploaded Source

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