feat(webui): open a currated version of the user accounts section to non admin users
This commit is contained in:
parent
2bf1731343
commit
d40595cacb
8 changed files with 49 additions and 24 deletions
|
@ -5,9 +5,11 @@ import (
|
|||
"net/http"
|
||||
|
||||
"git.adyxax.org/adyxax/tfstated/pkg/model"
|
||||
"go.n16f.net/uuid"
|
||||
)
|
||||
|
||||
type Page struct {
|
||||
AccountId uuid.UUID
|
||||
IsAdmin bool
|
||||
LightMode bool
|
||||
Section string
|
||||
|
@ -16,6 +18,7 @@ type Page struct {
|
|||
|
||||
func makePage(r *http.Request, page *Page) *Page {
|
||||
account := r.Context().Value(model.AccountContextKey{}).(*model.Account)
|
||||
page.AccountId = account.Id
|
||||
page.IsAdmin = account.IsAdmin
|
||||
settings := r.Context().Value(model.SettingsContextKey{}).(*model.Settings)
|
||||
page.LightMode = settings.LightMode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue