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/client_conn.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'hotline/client_conn.go') 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 -- cgit