Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
jeremystretch opened this issue Apr 7, 2022 · 2 comments
Labels
status: accepted This issue has been accepted for implementation topic: plugins Relates to the plugins framework type: feature Introduction of new functionality to the application
Milestone

Comments

@jeremystretch
Copy link
Member

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

@jeremystretch jeremystretch added type: feature Introduction of new functionality to the application status: under review Further discussion is needed to determine this issue's scope and/or implementation topic: plugins Relates to the plugins framework labels Apr 7, 2022
@sdktr
Copy link
Contributor

sdktr commented Apr 8, 2022

Even more plugin hooks, really nice work!

@github-actions
Copy link
Contributor

github-actions bot commented 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 github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Jun 8, 2022
@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release status: accepted This issue has been accepted for implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation pending closure Requires immediate attention to avoid being closed for inactivity needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Jun 23, 2022
@jeremystretch jeremystretch added this to the v3.3 milestone Jun 28, 2022
jeremystretch added a commit that referenced this issue Jun 30, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
status: accepted This issue has been accepted for implementation topic: plugins Relates to the plugins framework type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants