The Right class represents a users rights.
Hex.Right(iUserId) returns a new object of type Right.
For more information about how to create an instance of this object read Hex.Right(iUserId) section.
The rights system is hexhub is based on wich bits are set in a 64 bit number.
If you know nothing about the binary system, you should use the *ByName functions.
For more information about what rights exist in hexhub read the hexhub documentation.
This function returns true if the iBitNumber is set, otherwise it returns false.
Parameters:
-
iBitNumber = Range 0-63 where 0 is the first bit and 63 the last.
This function returns true if the has the right checked, otherwise it returns false.
Parameters:
-
sRightName = a string with the rights name (e.g. "connect1")
This function removes the iBitNumber right.
Hex Script versions < 1.2.0.1:
This function does not return a value
Hex Script versions >= 1.2.0.1:
This function returns false on error, and true on success.
Parameters:
-
iBitNumber = Range 0-63 where 0 is the first bit and 63 the last.
This function adds the iBitNumber right.
Hex Script versions < 1.2.0.1:
This function does not return a value
Hex Script versions >= 1.2.0.1:
This function returns false on error, and true on success.
Parameters:
-
iBitNumber = Range 0-63 where 0 is the first bit and 63 the last.
This function removes a right.
Hex Script versions < 1.2.0.1:
This function does not return a value
Hex Script versions >= 1.2.0.1:
This function returns false on error, and true on success.
Parameters:
-
sRightName = The name of the right to remove.
This function adds a right.
Hex Script versions < 1.2.0.1:
This function does not return a value
Hex Script versions >= 1.2.0.1:
This function returns false on error, and true on success.
Parameters:
-
sRightName = The name of the right to add.
local rights = Hex.Right(iUserId)
local bResult = rights:CheckRightByName("connect0")
if (bResult == true) then
-- user got the right
end
local rights = Hex.Right(iUserId)
rights:RemoveRightByName("connect0")
rights:AddRightByName("connect0")