Automatically set specific permissions

This commit is contained in:
Melon 2023-10-25 18:04:12 +01:00
parent ba90e41312
commit 1940f2de71
Signed by: melon
GPG Key ID: 6C9D970C50D26A25
2 changed files with 4 additions and 0 deletions

View File

@ -12,4 +12,5 @@ type Conf struct {
Issuer string `json:"issuer"` Issuer string `json:"issuer"`
SsoServices []issuer.SsoConfig `json:"sso_services"` SsoServices []issuer.SsoConfig `json:"sso_services"`
AllowedClients []utils.JsonUrl `json:"allowed_clients"` AllowedClients []utils.JsonUrl `json:"allowed_clients"`
Permissions []string `json:"permissions"`
} }

View File

@ -129,6 +129,9 @@ func (h *HttpServer) flowCallback(rw http.ResponseWriter, req *http.Request, _ h
} }
ps := claims.NewPermStorage() ps := claims.NewPermStorage()
for _, i := range h.conf.Permissions {
ps.Set(i)
}
if verified, ok := v3["email_verified"].(bool); ok && verified { if verified, ok := v3["email_verified"].(bool); ok && verified {
if mailAddress, ok := v3["email"].(string); ok { if mailAddress, ok := v3["email"].(string); ok {