Add NEEDS_LOGIN_FOR_SEARCH #6644

Closed
opened 2025-12-29 19:43:26 +01:00 by adam · 2 comments
Owner

Originally created by @johannwagner on GitHub (Jul 11, 2022).

NetBox version

v3.1.11

Feature type

New functionality

Proposed functionality

We propose a new configuration flag for NEEDS_LOGIN_FOR_SEARCH. This enforces a redirect to the login page, if an unauthenicated user wants to start a search.

Use case

In our Netbox configuration, we only allow viewing elements, if the user is logged in. This results into an empty result, if the user searches without authentication, which is confusing. The same search as authenticated user would result in at least one match.

Database changes

None

External dependencies

None

Originally created by @johannwagner on GitHub (Jul 11, 2022). ### NetBox version v3.1.11 ### Feature type New functionality ### Proposed functionality We propose a new configuration flag for `NEEDS_LOGIN_FOR_SEARCH`. This enforces a redirect to the login page, if an unauthenicated user wants to start a search. ### Use case In our Netbox configuration, we only allow viewing elements, if the user is logged in. This results into an empty result, if the user searches without authentication, which is confusing. The same search as authenticated user would result in at least one match. ### Database changes None ### External dependencies None
adam closed this issue 2025-12-29 19:43:27 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Jul 11, 2022):

I'm not sure I understand your use case. If you only allow logged in users to view objects, why is setting LOGIN_REQUIRED not sufficient for hiding the search field?

@kkthxbye-code commented on GitHub (Jul 11, 2022): I'm not sure I understand your use case. If you only allow logged in users to view objects, why is setting `LOGIN_REQUIRED` not sufficient for hiding the search field?
Author
Owner

@johannwagner commented on GitHub (Jul 11, 2022):

You are totally correct. Sorry for inconvenience, this solves our issue.

@johannwagner commented on GitHub (Jul 11, 2022): You are totally correct. Sorry for inconvenience, this solves our issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6644