Skip to main content

A Django package for managing user permissions and groups.

Project description

DJANGO GROUP_USER_PERMISSIONS

🔍 Overview

This package was developed because Django REST Framework (DRF) does not provide a built-in solution to check both user-level and group-level permissions in one place.

django-group-user-permissions is a custom DRF permission class that combines permissions assigned directly to a user and those inherited from the user’s groups. It simplifies permission handling in DRF-based APIs by dynamically checking permissions based on the request method and the model associated with the view.


📦 Installation

pip install django-group-user-permissions

⚙️ Configuration

  1. Add to INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
    
    "django-group-user-permissions",
]
  1. Import the permission class in your views:
from django_group_user_permissions.group_user_permissions import GroupUserPermissions
  1. 🚀 Usage in Views
permission_classes = [GroupUserPermissions]

✅ What It Does Maps HTTP methods to Django permission codenames:

GET → view_

POST → add_

PUT / PATCH → change_

DELETE → delete_

Checks if the user has required permission either:

Directly assigned to the user

Through any group the user belongs to

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_group_user_permissions-0.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_group_user_permissions-0.0.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file django_group_user_permissions-0.0.2.tar.gz.

File metadata

File hashes

Hashes for django_group_user_permissions-0.0.2.tar.gz
Algorithm Hash digest
SHA256 767b4976e3811a7b4f48701fa2e551387a373d44e072e44cd834f6b28fc501bf
MD5 393acbae872ffe9771b0f8b1a424c296
BLAKE2b-256 049fe68aae5bc8943856678276611155ebb7238bf539e60f35207f157cefb7c3

See more details on using hashes here.

File details

Details for the file django_group_user_permissions-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_group_user_permissions-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3760bef04fde77121eace54573262103f8674d302ce07d848d8982f796ff0836
MD5 cf6498f4a91a4676542bc3c4ac6370c4
BLAKE2b-256 eec94be655a68ba8d9e98b46ff761226bc6729321cc335d05cb4bb709ef2930e

See more details on using hashes here.

Supported by

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