]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/account.go
Refactor and backfill tests for tracker listing
[rbdr/mobius] / hotline / account.go
index 2c400aceafb56e28c6746f4f582d8347f69ddeab..a6808615f5fad507526b7b8b4ec3d59d52e0b9a6 100644 (file)
@@ -8,10 +8,10 @@ import (
 const GuestAccount = "guest" // default account used when no login is provided for a connection
 
 type Account struct {
 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
 }
 
 // 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))),
        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 {
        }
 
        if bcrypt.CompareHashAndPassword([]byte(a.Password), []byte("")) != nil {