Skip to content

Commit

Permalink
Update session.go
Browse files Browse the repository at this point in the history
  • Loading branch information
aimjel committed Nov 5, 2023
1 parent 63e5c7f commit cca312b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions server/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit cca312b

Please sign in to comment.