Flip the many-to-many relationships for users & groups to object permissions #15464
Labels
status: accepted
This issue has been accepted for implementation
type: housekeeping
Changes to the application which do not directly impact the end user
Milestone
Proposed Changes
There are currently many-to-many relationships from the ObjectPermission model to the User and Group models within the
users
app. These are both defined on the ObjectPermission model:This proposal entails moving the primary M2M field definitions from ObjectPermission to the User and Group models, as such:
This is essentially a cosmetic change, as the related field names for all three models will remain the same. However, a migration will be required to effect the swap and renamed the intermediary tables accordingly. There may also be some side effects of the reversal that need to be handled; testing will be needed to identify them. (In the event any serious blockers arise, this initiative should probably be punted.)
Justification
Moving these relationships to the User & Group models feels more natural and less surprising than the current arrangement, which exists only because NetBox did not employ custom user or group models prior to v4.0.
The text was updated successfully, but these errors were encountered: