[PR #503] [CLOSED] Fix created admin users not seeing settings button in sidebar #1055

Closed
opened 2026-05-06 12:34:44 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/503
Author: @kevdotnet
Created: 2/23/2026
Status: Closed

Base: 0.2.1b4Head: fix/new-admins-not-seeing-settings


📝 Commits (10+)

  • 1d0875e build(deps): bump aquasecurity/trivy-action
  • 5bcfadb Merge pull request #437 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c58
  • 10cae70 Updated CI
  • 971aa96 build(deps): bump aquasecurity/trivy-action
  • 0a725c0 Merge pull request #440 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c58
  • a361671 Updated CI
  • 036ae16 Updated CI
  • 2c0d1c2 Updated CI
  • 5d48ab8 Updated CI
  • 802bfe3 Updated CI

📊 Changes

6 files changed (+170 additions, -1988 deletions)

View changed files

📝 .github/workflows/ci.yml (+13 -6)
📝 .github/workflows/security.yml (+150 -33)
📝 frontend/package-lock.json (+3 -1943)
📝 frontend/package.json (+0 -2)
📝 frontend/src/components/Layout.tsx (+3 -3)
📝 frontend/src/contexts/AuthContext.tsx (+1 -1)

📄 Description

Description

I took some time to investigate the issue where created admin users could not see the settings button in the sidebar. I downloaded the newest version (main branch), ran it locally and could confirm that the issue is present in the latest version.

I noticed that the code only checks whether the user role is "user" in Layout.tsx:

const hideSettings = authEnabled && user?.role === 'user';

Unfortunately it seems that all users you create after the initial setup always have the "user" role in addition to the "admin" role.

I fixed this by checking for the "settings:read" permission instead:

const hideSettings = authEnabled && !hasPermission('settings:read');

Afterwards I noticed that when I login, the button is still not visible until I refresh the page.
I fixed this by running await checkAuthStatus(); instead of setUser(response.user); in the login function in AuthContext.tsx.

Fixes #501

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

See description

Testing

  • I have tested this on my local machine
  • I have tested with my printer model:

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/maziggy/bambuddy/pull/503 **Author:** [@kevdotnet](https://github.com/kevdotnet) **Created:** 2/23/2026 **Status:** ❌ Closed **Base:** `0.2.1b4` ← **Head:** `fix/new-admins-not-seeing-settings` --- ### 📝 Commits (10+) - [`1d0875e`](https://github.com/maziggy/bambuddy/commit/1d0875ee83992e2b1e22afac06639717e384211d) build(deps): bump aquasecurity/trivy-action - [`5bcfadb`](https://github.com/maziggy/bambuddy/commit/5bcfadbd8d6457d9b12bceb0ec1c127aae8286eb) Merge pull request #437 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c58 - [`10cae70`](https://github.com/maziggy/bambuddy/commit/10cae700f4702a6660baf66bdf8f673dc06f766d) Updated CI - [`971aa96`](https://github.com/maziggy/bambuddy/commit/971aa960a8280b414aac2077e91881f19fde40b0) build(deps): bump aquasecurity/trivy-action - [`0a725c0`](https://github.com/maziggy/bambuddy/commit/0a725c0ccc5744e1c1bd6fb14ea8a1dc2fcdace6) Merge pull request #440 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c58 - [`a361671`](https://github.com/maziggy/bambuddy/commit/a3616719526e6f9455742dcd59b6c1898ef50233) Updated CI - [`036ae16`](https://github.com/maziggy/bambuddy/commit/036ae16ad5511369bac94ab2a4f85169c817ec8f) Updated CI - [`2c0d1c2`](https://github.com/maziggy/bambuddy/commit/2c0d1c2fe6c77b13ee53d116831623f425257dac) Updated CI - [`5d48ab8`](https://github.com/maziggy/bambuddy/commit/5d48ab88f00f58cc472a72003a8cd246fa4b04e7) Updated CI - [`802bfe3`](https://github.com/maziggy/bambuddy/commit/802bfe330a568b1c434c527b29bc1a40612adb93) Updated CI ### 📊 Changes **6 files changed** (+170 additions, -1988 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+13 -6) 📝 `.github/workflows/security.yml` (+150 -33) 📝 `frontend/package-lock.json` (+3 -1943) 📝 `frontend/package.json` (+0 -2) 📝 `frontend/src/components/Layout.tsx` (+3 -3) 📝 `frontend/src/contexts/AuthContext.tsx` (+1 -1) </details> ### 📄 Description ## Description I took some time to investigate the issue where created admin users could not see the settings button in the sidebar. I downloaded the newest version (main branch), ran it locally and could confirm that the issue is present in the latest version. I noticed that the code only checks whether the user role is "user" in Layout.tsx: `const hideSettings = authEnabled && user?.role === 'user';` Unfortunately it seems that all users you create after the initial setup always have the "user" role in addition to the "admin" role. I fixed this by checking for the "settings:read" permission instead: `const hideSettings = authEnabled && !hasPermission('settings:read');` Afterwards I noticed that when I login, the button is still not visible until I refresh the page. I fixed this by running `await checkAuthStatus();` instead of `setUser(response.user);` in the login function in AuthContext.tsx. ## Related Issue Fixes #501 ## Type of Change - [x] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test addition or update ## Changes Made See description ## Testing - [x] I have tested this on my local machine - [ ] I have tested with my printer model: <!-- e.g., X1C, P1S, A1 --> ## Checklist - [x] My code follows the project's coding style - [x] I have commented my code where necessary - [ ] I have updated the documentation (if needed) - [x] My changes generate no new warnings - [x] I have tested my changes thoroughly --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:34:44 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy#1055
No description provided.