From 9bb99236cbf57ebb0acf0bfc33e5c292c659e867 Mon Sep 17 00:00:00 2001 From: RodrigoSilva Date: Thu, 15 Feb 2024 17:57:27 +0000 Subject: [PATCH] userAdmin --- data/service/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/service/user.go b/data/service/user.go index 9b807650..da7df98e 100644 --- a/data/service/user.go +++ b/data/service/user.go @@ -63,7 +63,7 @@ func (us *UserService) IsAdmin(email string) (bool, error) { return false, nil } - return user[0].IsAdmin, nil + return user[0].UserGroup != "" && strings.Contains(strings.ToLower(user[0].UserGroup), "admin"), nil } // this method gets all users from database