fix(ui): Admin sieht /manage mit allen Screens statt Redirect
This commit is contained in:
parent
f5d8311204
commit
bb30a75f5a
1 changed files with 7 additions and 1 deletions
|
|
@ -298,7 +298,13 @@ func HandleScreenOverview(screens *store.ScreenStore, schedules *store.ScreenSch
|
||||||
http.Redirect(w, r, "/login", http.StatusSeeOther)
|
http.Redirect(w, r, "/login", http.StatusSeeOther)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
accessible, err := screens.GetAccessibleScreens(r.Context(), u.ID)
|
var accessible []*store.Screen
|
||||||
|
var err error
|
||||||
|
if u.Role == "admin" {
|
||||||
|
accessible, err = screens.ListAll(r.Context())
|
||||||
|
} else {
|
||||||
|
accessible, err = screens.GetAccessibleScreens(r.Context(), u.ID)
|
||||||
|
}
|
||||||
if err != nil || len(accessible) == 0 {
|
if err != nil || len(accessible) == 0 {
|
||||||
http.Redirect(w, r, "/login?error=no_screens", http.StatusSeeOther)
|
http.Redirect(w, r, "/login?error=no_screens", http.StatusSeeOther)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue