From cca312b228cb4d4c412d30c3eb672049f9c89856 Mon Sep 17 00:00:00 2001 From: Angel Date: Sat, 4 Nov 2023 20:09:57 -0400 Subject: [PATCH] Update session.go --- server/session.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/server/session.go b/server/session.go index cf58157..e26cd60 100644 --- a/server/session.go +++ b/server/session.go @@ -730,15 +730,9 @@ func (p *Session) IP() string { } func (s *Session) HasPermissions(perms []string) bool { - if len(perms) == 0 { + if s.Player.Operator() { return true } - permissionsPlayer := permission.GetPlayer(s.Name()) - permissionsGroup := permission.GetGroup(permissionsPlayer.Group) - for _, perm := range perms { - if !permissionsPlayer.Permissions[perm] && !permissionsGroup.Permissions[perm] { - return false - } - } - return true + + return permission.HasPermissions(s.Name(), perms) }