-
Notifications
You must be signed in to change notification settings - Fork 10
Extend permissions framework to support model-level permissions #1010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for antenna-preview canceled.
|
class Meta: | ||
ordering = ["-priority", "created_at"] | ||
permissions = [ | ||
# Project permissions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be moved to base.models.BaseModel.Meta
?
You have to explicitly inherit from the class Meta(BaseModel.Meta)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding create_project
here makes sense for the Project
model! but for other models, they could either go on that model or the BaseModel with a dynamic method.
Summary
This update extends the permissions framework to handle both model-level and object-level permissions.
If a model has no related project or is linked to multiple projects, the framework now falls back to Django’s model-level permission checks.
This enables features like granting all authenticated users the ability to create projects while keeping project-based access unchanged.
List of Changes
TBD
Related Issues
#1006
Detailed Description
TBD
How to Test the Changes
TBD
Screenshots
TBD
Deployment Notes
TBD
Checklist