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
- Add to INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
"django-group-user-permissions",
]
- Import the permission class in your views:
from django_group_user_permissions.group_user_permissions import GroupUserPermissions
- 🚀 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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_group_user_permissions-0.0.2.tar.gz.
File metadata
- Download URL: django_group_user_permissions-0.0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
767b4976e3811a7b4f48701fa2e551387a373d44e072e44cd834f6b28fc501bf
|
|
| MD5 |
393acbae872ffe9771b0f8b1a424c296
|
|
| BLAKE2b-256 |
049fe68aae5bc8943856678276611155ebb7238bf539e60f35207f157cefb7c3
|
File details
Details for the file django_group_user_permissions-0.0.2-py3-none-any.whl.
File metadata
- Download URL: django_group_user_permissions-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3760bef04fde77121eace54573262103f8674d302ce07d848d8982f796ff0836
|
|
| MD5 |
cf6498f4a91a4676542bc3c4ac6370c4
|
|
| BLAKE2b-256 |
eec94be655a68ba8d9e98b46ff761226bc6729321cc335d05cb4bb709ef2930e
|