Closes #15754: Remove staff_only=True
from admin menu items
#15784
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #15754
staff_only=True
from all menu itemsThere's an odd issue here where regular users will see the API token items under the admin menu, because by default all users have permission to create their own tokens. We also can't hide the menu item from non-superusers entirely, because it's valid to assign a non-superuser permissions to create tokens for specific other accounts (e.g. service accounts), which can only be done via the admin views. So, I've settled on displaying a warning for non-superusers directing them to create tokens using the relevant account views.
(Note that there's no security issue here: Attempting to create/modify a token for another user will fail just as it will in the current release. I just want to mitigate the inevitable confusion of having two paths to create a token.)