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

Superuser with Staff status removed cannot access Admin menu #15733

Closed
markkuleinio opened this issue Apr 16, 2024 · 3 comments
Closed

Superuser with Staff status removed cannot access Admin menu #15733

markkuleinio opened this issue Apr 16, 2024 · 3 comments
Labels
beta Concerns a bug/feature in a beta release type: bug A confirmed report of unexpected behavior in the application

Comments

@markkuleinio
Copy link
Contributor

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.

@markkuleinio markkuleinio added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Apr 16, 2024
@markkuleinio
Copy link
Contributor Author

#15089 has some comments/discussion about the future of Staff status

@markkuleinio
Copy link
Contributor Author

markkuleinio commented 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?

@jeremystretch jeremystretch added the beta Concerns a bug/feature in a beta release label Apr 16, 2024
@jeremystretch
Copy link
Member

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 jeremystretch removed their assignment Apr 17, 2024
@jeremystretch jeremystretch added status: revisions needed This issue requires additional information to be actionable and removed status: needs triage This issue is awaiting triage by a maintainer labels Apr 17, 2024
@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
@jeremystretch jeremystretch removed the status: revisions needed This issue requires additional information to be actionable label Apr 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beta Concerns a bug/feature in a beta release type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants