Superuser with Staff status removed cannot access Admin menu #9485

Closed
opened 2025-12-29 20:50:33 +01:00 by adam · 3 comments
Owner

Originally created by @markkuleinio on GitHub (Apr 16, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.0-beta1

Python Version

3.11

Steps to Reproduce

  1. Go to users and open an admin user ("admin" in this example) who has Staff and Superuser status
  2. See the description for Staff status: "Designates whether the user can log into this admin site."
  3. Clear the Staff status for "admin" user and save the settings
  4. Login with the "admin" user
  5. See the main menu

Expected Behavior

The main menu has Admin section with all the options to manage users etc. because the user is a Superuser.

Observed Behavior

The "admin" user (with Superuser status) does not have the Admin menu shown.

Originally created by @markkuleinio on GitHub (Apr 16, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.0-beta1 ### Python Version 3.11 ### Steps to Reproduce 1. Go to users and open an admin user ("admin" in this example) who has Staff and Superuser status 2. See the description for Staff status: "Designates whether the user can log into this admin site." 3. Clear the Staff status for "admin" user and save the settings 4. Login with the "admin" user 5. See the main menu ### Expected Behavior The main menu has Admin section with all the options to manage users etc. because the user is a Superuser. ### Observed Behavior The "admin" user (with Superuser status) does not have the Admin menu shown.
adam added the type: bugbeta labels 2025-12-29 20:50:33 +01:00
adam closed this issue 2025-12-29 20:50:34 +01:00
Author
Owner

@markkuleinio commented on GitHub (Apr 16, 2024):

https://github.com/netbox-community/netbox/discussions/15089 has some comments/discussion about the future of Staff status

@markkuleinio commented on GitHub (Apr 16, 2024): https://github.com/netbox-community/netbox/discussions/15089 has some comments/discussion about the future of Staff status
Author
Owner

@markkuleinio commented on GitHub (Apr 16, 2024):

Also note that when the "admin" user logs in (after removing the Staff status) it shows "User" under the username, not "Superuser":

image

Maybe related to this same confusion about the user access level?

@markkuleinio commented on GitHub (Apr 16, 2024): Also note that when the "admin" user logs in (after removing the Staff status) it shows "User" under the username, not "Superuser": <img width="358" alt="image" src="https://github.com/netbox-community/netbox/assets/25136274/767859cb-3328-49d5-9898-3c270ae13fc1"> Maybe related to this same confusion about the user access level?
Author
Owner

@jeremystretch commented on GitHub (Apr 17, 2024):

I don't think it would be fair to treat this as a bug. All of the items under the "admin" navigation menu declare staff_only=True, with the intent that they be displayed only for users with is_staff=True. This applies both to the new views introduced in v4.0 as well as those that already exist in v3.7. Granted, the logic is a bit murky, especially with the Django admin UI now disabled by default in NetBox v4.0, but the behavior is intentional.

@markkuleinio could you please resubmit this as a feature request proposing the removal of staff_only=True from these menu items?

(Now that we have a custom User model [see #12795], I'd be in favor of dropping the is_staff designation entirely, but that will need to wait until we completely remove the Django admin UI from NetBox.)

@jeremystretch commented on GitHub (Apr 17, 2024): I don't think it would be fair to treat this as a bug. All of the items under the "admin" navigation menu declare `staff_only=True`, with the intent that they be displayed only for users with `is_staff=True`. This applies both to the new views introduced in v4.0 as well as those that already exist in v3.7. Granted, the logic is a bit murky, especially with the Django admin UI now disabled by default in NetBox v4.0, but the behavior is intentional. @markkuleinio could you please resubmit this as a feature request proposing the removal of `staff_only=True` from these menu items? (Now that we have a custom User model [see #12795], I'd be in favor of dropping the `is_staff` designation entirely, but that will need to wait until we completely remove the Django admin UI from NetBox.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9485