Use organization role to check for edit and delete perms of service instances #148

Closed
tobru wants to merge 1 commit from instance-edit-permi-from-org into main
Owner

Fixes #131

Fixes #131
tobru added 1 commit 2025-07-07 11:11:53 +00:00
use organization role to check for edit and delete perms
All checks were successful
Tests / test (push) Successful in 27s
46d323528e
requested review from rixx 2025-07-07 11:12:00 +00:00
rixx reviewed 2025-07-07 12:05:21 +00:00
@ -79,3 +82,1 @@
instance.has_change_permission = self.request.user.has_perm(
"core.change_serviceinstance", instance
)
instance.has_change_permission = has_admin_permission
Member

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#L121

If 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 the django-rules provided rules, and which places use methods like is_organization_admin directly.

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#L121 If 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 the `django-rules` provided rules, and which places use methods like `is_organization_admin` directly.
Author
Owner

May I assign this PR to you to clean up as proposed?

May I assign this PR to you to clean up as proposed?
tobru marked this conversation as resolved
Author
Owner

Replaced by #151

Replaced by #151
tobru closed this pull request 2025-07-11 14:56:15 +00:00
All checks were successful
Tests / test (push) Successful in 27s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: servala/servala-portal#148
No description provided.