Simplified permissions bit operations.
This commit is contained in:
parent
7834236044
commit
98ba68bb66
@ -145,9 +145,9 @@ class Permissions(object):
|
|||||||
# Then we take this value and look at the allowed values.
|
# Then we take this value and look at the allowed values.
|
||||||
# And whatever is allowed is set to 1.
|
# And whatever is allowed is set to 1.
|
||||||
# So 0000 OP2 0101 -> 0101
|
# So 0000 OP2 0101 -> 0101
|
||||||
# The OP is (base ^ denied) & ~denied.
|
# The OP is base & ~denied.
|
||||||
# The OP2 is base | allowed.
|
# The OP2 is base | allowed.
|
||||||
self.value = ((self.value ^ deny) & ~deny) | allow
|
self.value = (self.value & ~deny) | allow
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def can_create_instant_invite(self):
|
def can_create_instant_invite(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user