Content-Types only fetchable as logged in user #8356

Closed
opened 2025-12-29 20:35:44 +01:00 by adam · 2 comments
Owner

Originally created by @fabi125 on GitHub (Jul 21, 2023).

Originally assigned to: @fabi125 on GitHub.

NetBox version

v3.5.6

Python version

3.11

Steps to Reproduce

Config settings:

LOGIN_REQUIRED = False
EXEMPT_VIEW_PERMISSIONS = ["*"]

Try to access /api/extras/content-types/

Expected Behavior

List of content types is returned.

Observed Behavior

{"detail":"Authentication credentials were not provided."}

This view only uses IsAuthenticated while other views use IsAuthenticatedOrLoginNotRequired, which I believe is what should be used for ContentTypeViewSet as well.

Originally created by @fabi125 on GitHub (Jul 21, 2023). Originally assigned to: @fabi125 on GitHub. ### NetBox version v3.5.6 ### Python version 3.11 ### Steps to Reproduce Config settings: ``` LOGIN_REQUIRED = False EXEMPT_VIEW_PERMISSIONS = ["*"] ``` Try to access `/api/extras/content-types/` ### Expected Behavior List of content types is returned. ### Observed Behavior `{"detail":"Authentication credentials were not provided."}` This view only uses `IsAuthenticated` while other views use `IsAuthenticatedOrLoginNotRequired`, which I believe is what should be used for `ContentTypeViewSet` as well.
adam added the type: bugstatus: accepted labels 2025-12-29 20:35:44 +01:00
adam closed this issue 2025-12-29 20:35:44 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Jul 23, 2023):

This view only uses IsAuthenticated while other views use IsAuthenticatedOrLoginNotRequired, which I believe is what should be used for ContentTypeViewSet as well.

Seems right on the money. Would you like to submit a PR?

@kkthxbye-code commented on GitHub (Jul 23, 2023): > This view only uses IsAuthenticated while other views use IsAuthenticatedOrLoginNotRequired, which I believe is what should be used for ContentTypeViewSet as well. Seems right on the money. Would you like to submit a PR?
Author
Owner

@fabi125 commented on GitHub (Jul 23, 2023):

This view only uses IsAuthenticated while other views use IsAuthenticatedOrLoginNotRequired, which I believe is what should be used for ContentTypeViewSet as well.

Seems right on the money. Would you like to submit a PR?

Sure! I'll put one up today or tomorrow!

@fabi125 commented on GitHub (Jul 23, 2023): > > This view only uses IsAuthenticated while other views use IsAuthenticatedOrLoginNotRequired, which I believe is what should be used for ContentTypeViewSet as well. > > Seems right on the money. Would you like to submit a PR? Sure! I'll put one up today or tomorrow!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8356