* Owner perms were not being calculated correctly, this is now fixed

This commit is contained in:
shockrah 2020-11-21 19:18:40 -08:00
parent 063f2c7c48
commit 13eb58ec06
3 changed files with 4 additions and 5 deletions

View File

@ -121,7 +121,6 @@ if __name__ == '__main__':
msg_chan_id = time.time()
msg_chan_raw = worker.post('/channels/create', name=f'{msg_chan_id}', kind=TEXT_CHANNEL)
msg_chan = json.loads(msg_chan_raw)
print(f'Channel id to be used: {msg_chan["id"]}')
worker.post('/message/send', channel=msg_chan['id'], content="some random content")
worker.delete('/channels/delete', channel_id=msg_chan['id']) # finally clean up the channel we created

View File

@ -36,7 +36,9 @@ fn valid_perms(member: Member, path: &str) -> bool {
return (p & member.permissions) == p;
}
// if no perms then we don't care
return true;
else {
return true;
}
}
pub fn generate_secret() -> String {

View File

@ -8,8 +8,6 @@ pub const CREATE_TMP_INVITES:u64 = 4;
pub const CREATE_PERM_INVITES:u64 = 8; // to make perma invites you need both flags
pub const OWNER: u64 = 1 << 63;
pub const _ADMIN: u64 = 1 << 62; // can make other admins but can't really touch the owner
// ADMIN PERMS
@ -17,7 +15,7 @@ pub const CREATE_CHANNEL:u64 = 64;
pub const DELETE_CHANNEL:u64 = 128;
// BELOW ARE COLLECTIVE PERMISSION SETS
pub const _OWNER_PERMS: u64 = std::u64::MAX;
pub const OWNER: u64 = std::u64::MAX;
pub const GENERAL_NEW: u64 = JOIN_VOICE | SEND_MESSAGES | ALLOW_PFP | CHANGE_NICK;
pub const ADMIN_PERMS: u64 = !(std::u64::MAX & OWNER); // filter the only perm admins don't get