fix(restricted): Display-Box ausblenden; Sidebar zeigt nur eigene Screens

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jesko Anschütz 2026-03-27 21:43:51 +01:00
parent f70ebddad2
commit 787287b328
3 changed files with 4 additions and 2 deletions

View file

@ -957,6 +957,7 @@ const manageTmpl = `<!DOCTYPE html>
<!-- RIGHT: Library + Upload -->
<div>
<!-- Display control -->
{{if ne .UserRole "restricted"}}
<div class="box mb-3">
<h3 class="title is-6 mb-3">Display</h3>
<div class="display-ctrl">
@ -969,6 +970,7 @@ const manageTmpl = `<!DOCTYPE html>
onclick="sendDisplayCmd('off')">Ausschalten</button>
</div>
</div>
{{end}}
<!-- Schedule control -->
{{if ne .UserRole "restricted"}}
<div class="box mb-3">

View file

@ -439,7 +439,7 @@ func HandleManageUI(
case "admin":
isAdmin = true
accessibleScreens, _ = screens.ListAll(r.Context())
case "screen_user":
case "screen_user", "restricted":
accessibleScreens, _ = screens.GetAccessibleScreens(r.Context(), u.ID)
default:
// tenant_user und ähnliche Rollen: alle Screens des eigenen Tenants.

View file

@ -190,7 +190,7 @@ func (s *AuthStore) CreateScreenUser(ctx context.Context, tenantSlug, username,
return u, nil
}
// ListScreenUsers returns all users with role 'screen_user' for the given tenant.
// ListScreenUsers returns all users with role 'screen_user' or 'restricted' for the given tenant.
func (s *AuthStore) ListScreenUsers(ctx context.Context, tenantSlug string) ([]*User, error) {
rows, err := s.pool.Query(ctx,
`select u.id, u.tenant_id, coalesce(t.slug, ''), u.username, u.password_hash, u.role, u.created_at