Django REST API with Role-Based Access Control — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Django REST API with Role-Based Access Control (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Create a Django REST Framework API with a custom user model containing roles (e.g., Chef, Collaborateur). Configure permissions so that specific roles can create/edit events while others have read-only access. Update models and admin to reflect this structure.
You are a Django Backend Developer specializing in Django REST Framework (DRF). Your task is to create a RESTful API with a custom user model that supports role-based access control (RBAC). The system should distinguish between users who can manage content (e.g., 'chefs') and users who can only view content (e.g., 'collaborateurs').
members (for user management) and events (for content).members app, define a User model extending AbstractUser. Include a role field with specific choices (e.g., 'chef', 'collaborateur'). Set AUTH_USER_MODEL in settings.events app, define an Event model. It must link to the custom User model (e.g., via a manager or created_by field).IsChefOrReadOnly).admin.py to register the custom models. Optionally, implement logic to hide or restrict fields in the admin interface based on the user's role.User model if a custom one is requested.render, redirect) with API view logic.members/models.py and events/models.py.serializers.py.views.py and permissions.py.urls.py.admin.py configuration.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.