mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 08:25:54 +02:00
[PR #503] [CLOSED] Fix created admin users not seeing settings button in sidebar #1062
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy-maziggy-1#1062
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/maziggy/bambuddy/pull/503
Author: @kevdotnet
Created: 2/23/2026
Status: ❌ Closed
Base:
0.2.1b4← Head:fix/new-admins-not-seeing-settings📝 Commits (10+)
1d0875ebuild(deps): bump aquasecurity/trivy-action5bcfadbMerge pull request #437 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c5810cae70Updated CI971aa96build(deps): bump aquasecurity/trivy-action0a725c0Merge pull request #440 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c58a361671Updated CI036ae16Updated CI2c0d1c2Updated CI5d48ab8Updated CI802bfe3Updated 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 ofsetUser(response.user);in the login function in AuthContext.tsx.Related Issue
Fixes #501
Type of Change
Changes Made
See description
Testing
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.