这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@weidenba
Copy link
Contributor

No description provided.

@weidenba weidenba requested a review from jstucke April 10, 2018 12:08
@weidenba weidenba added the gui label Apr 10, 2018
@codecov-io
Copy link

codecov-io commented Apr 10, 2018

Codecov Report

Merging #95 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/helperFunctions/web_interface.py 86.66% <100%> (+1.48%) ⬆️
...rc/test/unit/helperFunctions/test_web_interface.py 100% <100%> (ø) ⬆️
src/web_interface/components/analysis_routes.py 95.87% <100%> (ø) ⬆️
src/test/acceptance/test_analyze_firmware.py 100% <100%> (ø) ⬆️
...test/integration/scheduler/test_cycle_with_tags.py 98.14% <0%> (-1.86%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 381c617...8dd44b5. Read the comment docs.



def is_superuser(user):
if isinstance(user._get_current_object(), AnonymousUser): # auth disabled
Copy link
Collaborator

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)")

Copy link
Collaborator

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))
Copy link
Collaborator

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 %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

@jstucke jstucke merged commit a43ca4c into master Apr 12, 2018
@weidenba weidenba deleted the experimental-authentication branch April 25, 2018 09:37
weidenba pushed a commit that referenced this pull request Oct 22, 2018
show admin options if logged in as admin only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants