X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/a7216f677e7b02831328293224730f6f06f2d38a..94742e2f44ca08a64c1851aa1a00c3e9f266d0e9:/hotline/client_conn.go?ds=sidebyside 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