[PR #7440] [CLOSED] Added permission check /api/dcim/connected-devices #13243

Closed
opened 2025-12-29 22:26:12 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/7440
Author: @xraurp
Created: 10/5/2021
Status: Closed

Base: developHead: connected_devices_permissions_fix


📝 Commits (1)

  • d6f6d0a Added permission check /api/dcim/connected-devices

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 netbox/dcim/api/views.py (+7 -0)

📄 Description

Fixes: netbox-community/netbox#7051

Affects /api/dcim/connected-device/

Api now checks dcim.view_device and dcim.view_interface permissions when login is required.
If login is not required, endpoint is available without permissions as before.
Set LOGIN_REQUIRED = True in configuration for this change to take effect.

Error message when permission is not sufficient:

HTTP 403 Forbidden
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "detail": "You do not have permission to perform this action."
}

🔄 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/7440 **Author:** [@xraurp](https://github.com/xraurp) **Created:** 10/5/2021 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `connected_devices_permissions_fix` --- ### 📝 Commits (1) - [`d6f6d0a`](https://github.com/netbox-community/netbox/commit/d6f6d0acf5acdbeee1e4740e8c9ec27d90c2cde9) Added permission check /api/dcim/connected-devices ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/api/views.py` (+7 -0) </details> ### 📄 Description ### Fixes: netbox-community/netbox#7051 Affects `/api/dcim/connected-device/` Api now checks `dcim.view_device` and `dcim.view_interface` permissions when login is required. If login is not required, endpoint is available without permissions as before. Set `LOGIN_REQUIRED = True` in configuration for this change to take effect. Error message when permission is not sufficient: ``` HTTP 403 Forbidden Allow: GET, HEAD, OPTIONS Content-Type: application/json Vary: Accept { "detail": "You do not have permission to perform this action." } ``` --- <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 22:26:12 +01:00
adam closed this issue 2025-12-29 22:26:12 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13243