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

Bibsonomy not working if DRF default permission is set to "DjangoObjectPermissions" #24

Closed
gregorpirgie opened this issue Apr 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@gregorpirgie
Copy link
Contributor

gregorpirgie commented Apr 4, 2023

Issue description:

  • Bibsonomy view serving bibsonomy-tooltip (apis_bibsonomy.api_views.SaveBibsonomyEntry) is a django-rest-framework (DRF) APIView.
  • So it pulls the default permissions for DRF from settings.py. For example, in apis-devops, default permission is set to "DjangoObjectPermissions"
  • this is not compatible with the view and throws this error: sentry issue

Possible fixes:

  • add get_queryset method to apis_bibsonomy.api_views.SaveBibsonomyEntry
  • change default DRF permissions in affected projects
  • overwrite default permission class in view by defining the class attribute permission_classes = [IsAuthenticated]

The more robust approach would be to refactor the view to be compatible with DjangoObjectPermissions. Quickest fix is setting permission class on view.

@gregorpirgie gregorpirgie added the bug Something isn't working label Apr 4, 2023
gregorpirgie added a commit that referenced this issue Apr 4, 2023
github-actions bot pushed a commit that referenced this issue Apr 4, 2023
## [0.4.1](v0.4.0...v0.4.1) (2023-04-04)

### Bug Fixes

* fixes issue [#24](#24) ([0586439](0586439))
@gregorpirgie
Copy link
Contributor Author

Issue is fixed with commit referenced above.

@gregorpirgie
Copy link
Contributor Author

Implemented solution in fix is adding the permission_classes attribute on the view-class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant