Implement scopes

This commit is contained in:
Tom 2023-05-03 14:21:58 +02:00
parent be07ac5d83
commit 064ae2f564
15 changed files with 232 additions and 137 deletions

View file

@ -101,7 +101,8 @@ func (resolver *Resolver) HandleRoute(ctx context.Context, route string) (http.H
ctx := resolverContext{
IndexContext: context,
}
if !resolver.Dependencies.Auth.Has(auth.User, r) {
if resolver.Dependencies.Auth.CheckScope("", component.ScopeUserLoggedIn, r) != nil {
ctx.IndexContext.Prefixes = nil
}
httpx.WriteHTML(tpl.Context(r, ctx), nil, t, "", w, r)