Designate an exception to gracefully abort under create/edit/delete views #6320

Closed
opened 2025-12-29 19:39:20 +01:00 by adam · 2 comments
Owner

Originally created by @jeremystretch on GitHub (Apr 7, 2022).

NetBox version

v3.2.0

Feature type

New functionality

Proposed functionality

The ultimate goal of this proposal is to support the following workflow:

  1. User attempts to create/edit/delete an object in NetBox using one of the standard UI views or REST API endpoints
  2. The pre_save or pre_delete signal is emitted and caught by a receiver interested in the object
  3. The receiver determines the operation should not be allowed (example: a plugin enforcing some arbitrary logic)
  4. The receiver raises AbortAction exception (actual name TBD)
  5. The view catches AbortAction and returns gracefully without completing the action

There are some implementation details still to iron out, but this should generally parallel the flow we have in place today to enforce permission constraints.

Use case

This will allow a plugin to participate in the standard CRUD workflows and disrupt them where necessary (e.g. to enforce supplementary validation) and abort the gracefully.

Database changes

No response

External dependencies

No response

Originally created by @jeremystretch on GitHub (Apr 7, 2022). ### NetBox version v3.2.0 ### Feature type New functionality ### Proposed functionality The ultimate goal of this proposal is to support the following workflow: 1. User attempts to create/edit/delete an object in NetBox using one of the standard UI views or REST API endpoints 2. The `pre_save` or `pre_delete` signal is emitted and caught by a receiver interested in the object 3. The receiver determines the operation should not be allowed (example: a plugin enforcing some arbitrary logic) 4. The receiver raises `AbortAction` exception (actual name TBD) 5. The view catches `AbortAction` and returns gracefully without completing the action There are some implementation details still to iron out, but this should generally parallel the flow we have in place today to enforce permission constraints. ### Use case This will allow a plugin to participate in the standard CRUD workflows and disrupt them where necessary (e.g. to enforce supplementary validation) and abort the gracefully. ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: featuretopic: plugins labels 2025-12-29 19:39:20 +01:00
adam closed this issue 2025-12-29 19:39:20 +01:00
Author
Owner

@sdktr commented on GitHub (Apr 8, 2022):

Even more plugin hooks, really nice work!

@sdktr commented on GitHub (Apr 8, 2022): Even more plugin hooks, really nice work!
Author
Owner

@github-actions[bot] commented on GitHub (Jun 8, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jun 8, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6320