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 -->
|
<!-- RIGHT: Library + Upload -->
|
||||||
<div>
|
<div>
|
||||||
<!-- Display control -->
|
<!-- Display control -->
|
||||||
|
{{if ne .UserRole "restricted"}}
|
||||||
<div class="box mb-3">
|
<div class="box mb-3">
|
||||||
<h3 class="title is-6 mb-3">Display</h3>
|
<h3 class="title is-6 mb-3">Display</h3>
|
||||||
<div class="display-ctrl">
|
<div class="display-ctrl">
|
||||||
|
|
@ -969,6 +970,7 @@ const manageTmpl = `<!DOCTYPE html>
|
||||||
onclick="sendDisplayCmd('off')">Ausschalten</button>
|
onclick="sendDisplayCmd('off')">Ausschalten</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
<!-- Schedule control -->
|
<!-- Schedule control -->
|
||||||
{{if ne .UserRole "restricted"}}
|
{{if ne .UserRole "restricted"}}
|
||||||
<div class="box mb-3">
|
<div class="box mb-3">
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,7 @@ func HandleManageUI(
|
||||||
case "admin":
|
case "admin":
|
||||||
isAdmin = true
|
isAdmin = true
|
||||||
accessibleScreens, _ = screens.ListAll(r.Context())
|
accessibleScreens, _ = screens.ListAll(r.Context())
|
||||||
case "screen_user":
|
case "screen_user", "restricted":
|
||||||
accessibleScreens, _ = screens.GetAccessibleScreens(r.Context(), u.ID)
|
accessibleScreens, _ = screens.GetAccessibleScreens(r.Context(), u.ID)
|
||||||
default:
|
default:
|
||||||
// tenant_user und ähnliche Rollen: alle Screens des eigenen Tenants.
|
// 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
|
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) {
|
func (s *AuthStore) ListScreenUsers(ctx context.Context, tenantSlug string) ([]*User, error) {
|
||||||
rows, err := s.pool.Query(ctx,
|
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
|
`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