From 1940f2de7162661eb10c97fae7dc3bfa0073ab2f Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Wed, 25 Oct 2023 18:04:12 +0100 Subject: [PATCH] Automatically set specific permissions --- server/conf.go | 1 + server/flow.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/server/conf.go b/server/conf.go index bb7ddbb..ef9afa7 100644 --- a/server/conf.go +++ b/server/conf.go @@ -12,4 +12,5 @@ type Conf struct { Issuer string `json:"issuer"` SsoServices []issuer.SsoConfig `json:"sso_services"` AllowedClients []utils.JsonUrl `json:"allowed_clients"` + Permissions []string `json:"permissions"` } diff --git a/server/flow.go b/server/flow.go index 1d7e3a3..f802853 100644 --- a/server/flow.go +++ b/server/flow.go @@ -129,6 +129,9 @@ func (h *HttpServer) flowCallback(rw http.ResponseWriter, req *http.Request, _ h } ps := claims.NewPermStorage() + for _, i := range h.conf.Permissions { + ps.Set(i) + } if verified, ok := v3["email_verified"].(bool); ok && verified { if mailAddress, ok := v3["email"].(string); ok {