Fix permission issue for editing or deleting instances #151

Merged
tobru merged 3 commits from 148-instance-edit-permissions into main 2025-07-11 14:55:48 +00:00
Member

Alternative to #148 – does this resolve the problem observed? I followed the other PR in making it so that only org admins, not org members, can change instances.

Additionally, I added a rule that grants "admin dashboard" permissions to staff users. Up until now, staff users were able to see, edit and delete objects, but did not see any indication of this on the dashboard, which was empty.

Alternative to #148 – does this resolve the problem observed? I followed the other PR in making it so that only org admins, not org members, can change instances. Additionally, I added a rule that grants "admin dashboard" permissions to staff users. Up until now, staff users were able to see, edit and delete objects, but did not see any indication of this on the dashboard, which was empty.
rixx force-pushed 148-instance-edit-permissions from 4c0a656ed4 to 5feabda513 2025-07-11 10:25:56 +00:00 Compare
Owner

@rixx Unfortunately, no. A regular user without any Django permissions (staff or superuser) cannot edit or delete a service instance. IMHO we should not rely on the Django permissions but on the role the user has in the Organization.

@rixx Unfortunately, no. A regular user without any Django permissions (staff or superuser) cannot edit or delete a service instance. IMHO we should not rely on the Django permissions but on the role the user has in the Organization.
rixx added 1 commit 2025-07-11 14:38:59 +00:00
Make rules compatible with instance checks
All checks were successful
Tests / test (push) Successful in 26s
0bd895c486
Author
Member

@tobru Hm, but that's what's meant to happen regardless – you can see that Django uses the django-rules permissions in User.has_perm by checking out this PR and comparing the look of the admin interface as a staff user.

I found the bug, though – the problem was that the checks were originally tailored to the Organization model, and were not flexible enough to look up the organization when given an instance. Fixed this in 0bd895c.

@tobru Hm, but that's what's meant to happen regardless – you can see that Django uses the django-rules permissions in `User.has_perm` by checking out this PR and comparing the look of the admin interface as a staff user. I found the bug, though – the problem was that the checks were originally tailored to the Organization model, and were not flexible enough to look up the organization when given an instance. Fixed this in 0bd895c.
tobru merged commit 683977a001 into main 2025-07-11 14:55:48 +00:00
tobru deleted branch 148-instance-edit-permissions 2025-07-11 14:55:48 +00:00
Owner

Perfect, now it works as intended

Perfect, now it works as intended
tobru changed title from Try to fix permissions issue to Fix permission issue for editing or deleting instances 2025-07-11 14:56:35 +00:00
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#151
No description provided.