Skip to content

[UI] Adjust "superuser warning" banner#11696

Merged
SchrodingersGat merged 5 commits intoinventree:masterfrom
SchrodingersGat:superuser-warning
Apr 10, 2026
Merged

[UI] Adjust "superuser warning" banner#11696
SchrodingersGat merged 5 commits intoinventree:masterfrom
SchrodingersGat:superuser-warning

Conversation

@SchrodingersGat
Copy link
Copy Markdown
Member

@SchrodingersGat SchrodingersGat commented Apr 8, 2026

  • fix typo: evelevated -> elevated
  • visual tweaks
  • adds some playwright tests
  • adds new settings to control display of banner(s)

- evelevated -> elevated
@SchrodingersGat SchrodingersGat added this to the 1.3.0 milestone Apr 8, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 8, 2026

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 7a5a36d
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/69d82c51c26ff900080fd83b
😎 Deploy Preview https://deploy-preview-11696--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 92 (no change from production)
Accessibility: 81 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@SchrodingersGat SchrodingersGat added the User Interface Related to the frontend / User Interface label Apr 8, 2026
@SchrodingersGat SchrodingersGat changed the title [UI] Fix typo [UI] Adjust "superuser warning" banner Apr 8, 2026
!elevatedAlertClosed &&
!window.INVENTREE_SETTINGS.dangerous_hide_evelevated_alert,
[user, elevatedAlertClosed]
(user?.is_superuser || false) &&
Copy link
Copy Markdown
Member

@matmair matmair Apr 8, 2026

Choose a reason for hiding this comment

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

This defeats half of the purpose of this. As we recently learned the hard way: the “staff” user flag is also dangerous and should be guarded. Not warning against it will lead to ppl not reading the docs and being unaware of the risky thing they are doing by using a user with that flag

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I 100% agree for a superuser - but IMO operating as a staff user is expected.

Otherwise, does every "staff" user need a secondary account for their day-to-day operations?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

given the current security boundaries for templates: yes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have added two separate settings to control this then. They can be hard-coded via environment variables - as with any other setting.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.39%. Comparing base (4b3b03e) to head (7a5a36d).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #11696   +/-   ##
=======================================
  Coverage   91.39%   91.39%           
=======================================
  Files         966      966           
  Lines       50050    50050           
=======================================
  Hits        45742    45742           
  Misses       4308     4308           
Flag Coverage Δ
backend 89.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend Apps 91.73% <ø> (ø)
Backend General 93.41% <ø> (ø)
Frontend ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SchrodingersGat SchrodingersGat merged commit 01bb113 into inventree:master Apr 10, 2026
39 checks passed
@SchrodingersGat SchrodingersGat deleted the superuser-warning branch April 10, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants