aboutsummaryrefslogtreecommitdiff
path: root/hotline/client_conn.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/client_conn.go
parentf168da153f3984af6d532b979219310242f0b8d1 (diff)
Refactor user access bitmap handling
Diffstat (limited to 'hotline/client_conn.go')
-rw-r--r--hotline/client_conn.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/hotline/client_conn.go b/hotline/client_conn.go
index 076919f..7f78704 100644
--- a/hotline/client_conn.go
+++ b/hotline/client_conn.go
@@ -135,9 +135,7 @@ func (cc *ClientConn) uint16ID() uint16 {
// Authorize checks if the user account has the specified permission
func (cc *ClientConn) Authorize(access int) bool {
- i := big.NewInt(int64(binary.BigEndian.Uint64(*cc.Account.Access)))
-
- return i.Bit(63-access) == 1
+ return cc.Account.Access.IsSet(access)
}
// Disconnect notifies other clients that a client has disconnected