[PR #20353] [MERGED] Closes #15492: Add support for cloning ObjectPermission objects #15901

Closed
opened 2025-12-30 00:24:42 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20353
Author: @pheus
Created: 9/14/2025
Status: Merged
Merged: 9/15/2025
Merged by: @jeremystretch

Base: mainHead: 15492-add-objectpermission-cloning-support


📝 Commits (1)

  • 4ea543d feat(users): Add support for cloning ObjectPermission objects

📊 Changes

2 files changed (+40 additions, -13 deletions)

View changed files

📝 netbox/users/forms/model_forms.py (+34 -12)
📝 netbox/users/models/permissions.py (+6 -1)

📄 Description

Fixes: #15492

Summary
Add a Clone action to Admin → Authentication → Permissions. Clicking Clone opens the create form pre‑populated from an existing permission (name cleared), making it quick to duplicate rules without re‑entering object types, actions, and constraints.

Implementation

  • Enable cloning for ObjectPermission via CloningMixin.
  • Add a Clone button to the permission detail view.
  • Provide initial form data from the source permission, including constraints.

🔄 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/20353 **Author:** [@pheus](https://github.com/pheus) **Created:** 9/14/2025 **Status:** ✅ Merged **Merged:** 9/15/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `15492-add-objectpermission-cloning-support` --- ### 📝 Commits (1) - [`4ea543d`](https://github.com/netbox-community/netbox/commit/4ea543d404ac98a62d8dbe75730cab5f920cf564) feat(users): Add support for cloning ObjectPermission objects ### 📊 Changes **2 files changed** (+40 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `netbox/users/forms/model_forms.py` (+34 -12) 📝 `netbox/users/models/permissions.py` (+6 -1) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #15492 **Summary** Add a **Clone** action to **Admin → Authentication → Permissions**. Clicking **Clone** opens the create form pre‑populated from an existing permission (name cleared), making it quick to duplicate rules without re‑entering object types, actions, and constraints. **Implementation** - Enable cloning for `ObjectPermission` via `CloningMixin`. - Add a **Clone** button to the permission detail view. - Provide `initial` form data from the source permission, including `constraints`. --- <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-30 00:24:42 +01:00
adam closed this issue 2025-12-30 00:24:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15901