You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Django permission group naming can be misleading #7003
breakingIndicates a major update or change which breaks compatibilityinactiveIndicates lack of activityquestionThis is a questionrefactorsecurityRelates to a security issue
Within my work here, I'm noticing the Django permission groups tend to be a bit misleading with regards to what a general user would think they imply.
What a user might think:
View: I can see the elements in this category
Add: I can create new entries in this category
Change: I can edit exisiting entries in this category
Delete: I can remove/delete entries in this category
What actually is the case:
View: I can perform GET requests
Add: I can perform POST requests
Change: I Can perform PATCH/PUT requests
Delete: I can perform DELETE requests
Here's where theory collides with practise.
We have a lot of what one would consider "Change"-defined actions performed via POST requests. State transitions and receiving line items to name two. This inevitably leads to confusion. And for some it might be a problem as they want to granularly limit creating things and managing exisiting things to different groups of employees.
I've created the issue without a template, as it's not a bug per se, but more a call for discussion on the topic.
@LavissaWoW I would agree, that a POST request is not always the same thing as a create operation - perhaps you can compile a list of API actions where you think the permission is incorrectly specified? We may need to either manually adjust the permissions on those endpoints, or reassess how we implement the roles
@SchrodingersGat Sure thing. I'm aware of the different apps in the system. I only need to run through all the API endpoint definitions, and I'll be able to compile a list of possible discrepancies.
@SchrodingersGat@matmair See the above list of endpoints that I feel should not require ADD permissions, but do currently, because they're POST requests.
Any change to the permission system is a security risk and a highly breaking so it ought to be well thought out. There are a few open issues with the permission system, those should be addressed too if we require every user to reevaluate all their permissions.
The big "issue" here is that we have associated our "add" role with a "POST" style request - which makes sense for simple CRUD operations but our API is much more complex than that. I think there is space to re-evalate the permissions (in line with more "logical" operations) - but this would be a change which breaks workflow for existing users at a bare minimum.
@matmair there are security concerns to be argued over requiring any meaningful actions require full POST access too. Such a system leads to a lot of users having a lot of power they might not need or "deserve"
breakingIndicates a major update or change which breaks compatibilityinactiveIndicates lack of activityquestionThis is a questionrefactorsecurityRelates to a security issue
Activity
[-]django perm[/-][+]Django permission group naming can be misleading[/+]LavissaWoW commentedon Apr 11, 2024
Case in point, actually:
CUI defines PO state change buttons to be visible if
roles.purchase_order.changeis true.But clicking any button throws:
SchrodingersGat commentedon Apr 11, 2024
@LavissaWoW I would agree, that a
POSTrequest is not always the same thing as acreateoperation - perhaps you can compile a list of API actions where you think the permission is incorrectly specified? We may need to either manually adjust the permissions on those endpoints, or reassess how we implement the rolesLavissaWoW commentedon Apr 11, 2024
@SchrodingersGat Sure thing. I'm aware of the different apps in the system. I only need to run through all the API endpoint definitions, and I'll be able to compile a list of possible discrepancies.
LavissaWoW commentedon Apr 16, 2024
LavissaWoW commentedon Apr 16, 2024
@SchrodingersGat @matmair See the above list of endpoints that I feel should not require ADD permissions, but do currently, because they're POST requests.
matmair commentedon Apr 16, 2024
Any change to the permission system is a security risk and a highly breaking so it ought to be well thought out. There are a few open issues with the permission system, those should be addressed too if we require every user to reevaluate all their permissions.
FYI there are discussions on GitHub.
SchrodingersGat commentedon Apr 18, 2024
The big "issue" here is that we have associated our "add" role with a "POST" style request - which makes sense for simple CRUD operations but our API is much more complex than that. I think there is space to re-evalate the permissions (in line with more "logical" operations) - but this would be a change which breaks workflow for existing users at a bare minimum.
LavissaWoW commentedon Apr 18, 2024
@matmair there are security concerns to be argued over requiring any meaningful actions require full POST access too. Such a system leads to a lot of users having a lot of power they might not need or "deserve"
github-actions commentedon Jun 18, 2024
This issue seems stale. Please react to show this is still important.