aboutsummaryrefslogtreecommitdiff
path: root/hotline/account.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-26 15:40:18 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-26 15:40:18 -0700
commit187d6dc500784760654b740a278fef59072ca5a8 (patch)
tree856f011e322446bf16c0f77e676e82901d0dd93b /hotline/account.go
parentf168da153f3984af6d532b979219310242f0b8d1 (diff)
Refactor user access bitmap handling
Diffstat (limited to 'hotline/account.go')
-rw-r--r--hotline/account.go10
1 files changed, 5 insertions, 5 deletions
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 {