[PR #15554] [MERGED] Closes #15464: Move permission assignments to user & group models #14613

Closed
opened 2025-12-29 23:25:30 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/15554
Author: @jeremystretch
Created: 3/27/2024
Status: Merged
Merged: 3/29/2024
Merged by: @jeremystretch

Base: featureHead: 15464-objectpermission-m2m-fields


📝 Commits (2)

  • a673015 Move user & group M2M assignments for ObjectPermission
  • 37a003a Restore users & groups fields on ObjectPermission serializer

📊 Changes

8 files changed (+255 additions, -87 deletions)

View changed files

📝 netbox/netbox/api/serializers/base.py (+2 -1)
📝 netbox/users/api/serializers_/permissions.py (+8 -9)
📝 netbox/users/api/serializers_/users.py (+20 -3)
📝 netbox/users/forms/model_forms.py (+14 -12)
netbox/users/migrations/0008_flip_objectpermission_assignments.py (+122 -0)
📝 netbox/users/models.py (+10 -10)
📝 netbox/users/tests/test_api.py (+74 -49)
📝 netbox/utilities/testing/base.py (+5 -3)

📄 Description

Fixes: #15464

  • Remove the groups and users ManyToManyFields from ObjectPermission
  • Introduce an object_permissions ManyToManyField on the User & Group models
  • Add a migration to fake the field changes by renaming the SQL table & related indexes
  • Update the model forms & API serializers to accommodate the reversed relationships

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/15554 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 3/27/2024 **Status:** ✅ Merged **Merged:** 3/29/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `15464-objectpermission-m2m-fields` --- ### 📝 Commits (2) - [`a673015`](https://github.com/netbox-community/netbox/commit/a673015f86e18a4e795bea26082e281635dd5b79) Move user & group M2M assignments for ObjectPermission - [`37a003a`](https://github.com/netbox-community/netbox/commit/37a003afea6459e52cc1ec12aedae0259df9c2d8) Restore users & groups fields on ObjectPermission serializer ### 📊 Changes **8 files changed** (+255 additions, -87 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/api/serializers/base.py` (+2 -1) 📝 `netbox/users/api/serializers_/permissions.py` (+8 -9) 📝 `netbox/users/api/serializers_/users.py` (+20 -3) 📝 `netbox/users/forms/model_forms.py` (+14 -12) ➕ `netbox/users/migrations/0008_flip_objectpermission_assignments.py` (+122 -0) 📝 `netbox/users/models.py` (+10 -10) 📝 `netbox/users/tests/test_api.py` (+74 -49) 📝 `netbox/utilities/testing/base.py` (+5 -3) </details> ### 📄 Description ### Fixes: #15464 - Remove the `groups` and `users` ManyToManyFields from ObjectPermission - Introduce an `object_permissions` ManyToManyField on the User & Group models - Add a migration to fake the field changes by renaming the SQL table & related indexes - Update the model forms & API serializers to accommodate the reversed relationships --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:25:30 +01:00
adam closed this issue 2025-12-29 23:25:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14613