Use organization role to check for edit and delete perms of service instances #148
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: servala/servala-portal#148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "instance-edit-permi-from-org"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #131
@ -79,3 +82,1 @@
instance.has_change_permission = self.request.user.has_perm(
"core.change_serviceinstance", instance
)
instance.has_change_permission = has_admin_permission
You could instead remove the
is_staff
permission from https://servala.app.codey.ch/servala/servala-portal/src/branch/main/src/servala/core/models/organization.py#L121If you prefer to do the permission checks like this, I think we should remove the whole
rules_permissions
approach, because otherwise, it’ll be really unclear which places (views, middlewares, etc) will use thedjango-rules
provided rules, and which places use methods likeis_organization_admin
directly.May I assign this PR to you to clean up as proposed?
Replaced by #151
Pull request closed