From d1122bab297a4fe64d66330de4551a39becf4599 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Wed, 30 Dec 2020 12:24:14 -0500 Subject: [PATCH] Admins only get passwords. --- auth.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/auth.go b/auth.go index ad95b3a..fa5911a 100644 --- a/auth.go +++ b/auth.go @@ -24,8 +24,12 @@ func reqPass(w http.ResponseWriter, r *http.Request) { if err == nil { for _, m := range g { if strings.ToUpper(m.Nick) == strings.ToUpper(username) { - userID = m.User.ID - log.LogInfo("User ID found for %+v as %+v", username, userID) + for _, r := range m.Roles { + if r == config.AdminRole { + userID = m.User.ID + log.LogInfo("User ID found for %+v as %+v", username, userID) + } + } } } } else {