Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
django-auto-permissions
Advanced tools
Django Auto Permissions is a Django library designed to automatically generate and apply permissions for custom methods defined in Django Rest Framework viewsets. It simplifies the process of managing permissions, ensuring that each custom viewset method has its corresponding permission without manually creating them.
Install django_auto_permissions
via pip:
pip install django_auto_permissions
After installation, add auto_permissions
to your INSTALLED_APPS
in Django's settings.py
:
INSTALLED_APPS = [
# ... other installed apps ...
'django_auto_permissions',
]
In your viewsets file, register each viewset with its corresponding model using ViewsetRegistrar
.
# In your viewsets.py
from django_auto_permissions.registration import ViewsetRegistrar
from myapp.models import MyModel
from myapp.viewsets import MyViewSet
# Register the viewset and model
ViewsetRegistrar.register(MyViewSet, MyModel)
This should be done before running your Django project, ideally in a module that gets loaded on startup, such as views.py
or models.py
.
Once your Django project is running, the library will automatically generate and register permissions for your custom viewset methods. These permissions can be viewed and managed in the Django admin interface.
Contributions to django_auto_permissions
are welcome! Please read our contributing guidelines for submitting pull requests.
This project is licensed under the MIT License.
For support or queries, reach out to [Your Email or Contact Information].
FAQs
Automated permission generation for Django viewsets
We found that django-auto-permissions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.