Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Closed
kkthxbye-code opened this issue Jun 6, 2023 · 0 comments · Fixed by #12896
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@kkthxbye-code
Copy link
Contributor

kkthxbye-code commented Jun 6, 2023

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.

@kkthxbye-code kkthxbye-code added type: bug A confirmed report of unexpected behavior in the application status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Jun 6, 2023
@abhi1693 abhi1693 self-assigned this Jun 14, 2023
@abhi1693 abhi1693 added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Jun 14, 2023
abhi1693 added a commit that referenced this issue Jun 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants