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:
parent
f70ebddad2
commit
787287b328
3 changed files with 4 additions and 2 deletions
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue