Fixes #21242: Show Authentication admin menu items based on object perms #475

Closed
opened 2026-04-05 16:34:52 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pheus on 1/23/2026

Fixes: #21242

This PR adjusts the Admin → Authentication menu items to follow the usual object-permission checks again (instead of being gated behind staff_only).

Concretely, it replaces the hardcoded menu definitions for Users, Groups, API Tokens, and Permissions with get_model_item(). This removes the staff_only restriction for these items and relies on the standard view_*/add_* permissions and button actions provided by the helper.

This aligns with the intent discussed in #21242: System items remain superuser-only, while Authentication items should be available to non-superusers when they have the relevant permissions. Thanks to the maintainers for the clarification and guidance on the expected behavior.

*Originally created by @pheus on 1/23/2026* <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #21242 <!-- Please include a summary of the proposed changes below. --> This PR adjusts the Admin → Authentication menu items to follow the usual object-permission checks again (instead of being gated behind `staff_only`). Concretely, it replaces the hardcoded menu definitions for **Users**, **Groups**, **API Tokens**, and **Permissions** with `get_model_item()`. This removes the `staff_only` restriction for these items and relies on the standard `view_*`/`add_*` permissions and button actions provided by the helper. This aligns with the intent discussed in #21242: **System** items remain superuser-only, while **Authentication** items should be available to non-superusers when they have the relevant permissions. Thanks to the maintainers for the clarification and guidance on the expected behavior.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#475