DataSourceViewSet erroneously references a extras.sync_datasource permission instead of core.sync_datasource #8165

Closed
opened 2025-12-29 20:33:17 +01:00 by adam · 0 comments
Owner

Originally created by @kkthxbye-code on GitHub (Jun 6, 2023).

Originally assigned to: @abhi1693 on GitHub.

NetBox version

v3.5.3

Python version

3.10

Steps to Reproduce

  1. Create a local datasource file:///tmp/
  2. Create a user testuser with all permissions and the additional permission sync
  3. With the new user send a post request to the data-source sync endpoint, e.g. http://127.0.0.1:8001/api/core/data-sources/1/sync/

Expected Behavior

Datasource should be synced as user has all permissions.

Observed Behavior

The API returns:

{
  "detail": "Syncing data sources requires the core.sync_datasource permission."
}

The cause is here, just needs to be changed. Was probably missed when stuff was moved to the core app.

e40e9cb406/netbox/core/api/views.py (L36)

if not request.user.has_perm('extras.sync_datasource'):

Should be core.sync_datasource.

Originally created by @kkthxbye-code on GitHub (Jun 6, 2023). Originally assigned to: @abhi1693 on GitHub. ### NetBox version v3.5.3 ### Python version 3.10 ### Steps to Reproduce 1. Create a local datasource file:///tmp/ 2. Create a user testuser with all permissions and the additional permission `sync` 3. With the new user send a post request to the data-source sync endpoint, e.g. http://127.0.0.1:8001/api/core/data-sources/1/sync/ ### Expected Behavior Datasource should be synced as user has all permissions. ### Observed Behavior The API returns: ``` { "detail": "Syncing data sources requires the core.sync_datasource permission." } ``` The cause is here, just needs to be changed. Was probably missed when stuff was moved to the core app. https://github.com/devon-mar/netbox/blob/e40e9cb4064b7128e4a590fa3a99d5ff0a45723c/netbox/core/api/views.py#L36 ```python if not request.user.has_perm('extras.sync_datasource'): ``` Should be `core.sync_datasource`.
adam added the type: bugstatus: accepted labels 2025-12-29 20:33:17 +01:00
adam closed this issue 2025-12-29 20:33:18 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8165