-
Notifications
You must be signed in to change notification settings - Fork 238
show admin options if logged in as admin only #95
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #95 +/- ##
==========================================
- Coverage 94.16% 94.16% -0.01%
==========================================
Files 290 290
Lines 13977 13992 +15
==========================================
+ Hits 13162 13176 +14
- Misses 815 816 +1
Continue to review full report at Codecov.
|
src/helperFunctions/web_interface.py
Outdated
|
|
||
|
|
||
| def is_superuser(user): | ||
| if isinstance(user._get_current_object(), AnonymousUser): # auth disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be more intuitive if this functionality was put in its own function (e.g. "auth_is_enabled(user)"), since it has little to do with whether or not the user is a "superuser"
it would then need to be tested first (e.g. "if not auth_is_enabled(user) or is_superuser(user)")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_has_admin_clearance()
| other_versions=other_versions, | ||
| uids_for_comparison=uids_for_comparison) | ||
| uids_for_comparison=uids_for_comparison, | ||
| show_admin_panal=is_superuser(current_user)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo? (panel)
| </div> | ||
| {# admin buttons #} | ||
| {% if firmware.vendor %} | ||
| {% if firmware.vendor and show_admin_panal %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
show admin options if logged in as admin only
No description provided.