From 187d6dc500784760654b740a278fef59072ca5a8 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Sun, 26 Jun 2022 15:40:18 -0700 Subject: Refactor user access bitmap handling --- hotline/account.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hotline/account.go') diff --git a/hotline/account.go b/hotline/account.go index 2c400ac..a680861 100644 --- a/hotline/account.go +++ b/hotline/account.go @@ -8,10 +8,10 @@ import ( const GuestAccount = "guest" // default account used when no login is provided for a connection type Account struct { - Login string `yaml:"Login"` - Name string `yaml:"Name"` - Password string `yaml:"Password"` - Access *[]byte `yaml:"Access"` // 8 byte bitmap + Login string `yaml:"Login"` + Name string `yaml:"Name"` + Password string `yaml:"Password"` + Access accessBitmap `yaml:"Access"` } // Read implements io.Reader interface for Account @@ -19,7 +19,7 @@ func (a *Account) Read(p []byte) (n int, err error) { fields := []Field{ NewField(fieldUserName, []byte(a.Name)), NewField(fieldUserLogin, negateString([]byte(a.Login))), - NewField(fieldUserAccess, *a.Access), + NewField(fieldUserAccess, a.Access[:]), } if bcrypt.CompareHashAndPassword([]byte(a.Password), []byte("")) != nil { -- cgit