Skip to content

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

@kkthxbye-code

Description

@kkthxbye-code

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

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

Should be core.sync_datasource.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions