Improvements for tokens

This commit is contained in:
Tom 2023-06-29 08:59:19 +02:00
parent effa79aacd
commit 8ccd490bed
15 changed files with 34 additions and 30 deletions

View file

@ -47,12 +47,12 @@ func (admin *Admin) Routes() component.Routes {
return component.Routes{
Prefix: "/admin/",
CSRF: true,
Decorator: admin.Dependencies.Auth.Require(false, scopes.ScopeAdminLoggedIn, nil),
Decorator: admin.Dependencies.Auth.Require(false, scopes.ScopeUserAdmin, nil),
}
}
func (admin *Admin) Menu(r *http.Request) []component.MenuItem {
if admin.Dependencies.Auth.CheckScope("", scopes.ScopeAdminLoggedIn, r) != nil {
if admin.Dependencies.Auth.CheckScope("", scopes.ScopeUserAdmin, r) != nil {
return nil
}
return []component.MenuItem{