Clean up unncessary conditional. Add explicit auth/ tests for empty credentials/anonymous case

This commit is contained in:
Neal Harrington
2022-07-25 22:02:28 -04:00
parent 7cceb822a4
commit 8921ee002e
2 changed files with 12 additions and 6 deletions

View File

@@ -182,12 +182,9 @@ func (s *Service) checkCommandPerm(c *Command, perm string) bool {
return true
}
var username string
var password string
if c.Credentials == nil {
username = ""
password = ""
} else {
username := ""
password := ""
if c.Credentials != nil {
username = c.Credentials.GetUsername()
password = c.Credentials.GetPassword()
}