discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.5k stars 3.97k forks source link

ChannelPermissions gives all true if user can Manage Roles #507

Closed presentday-presenttime closed 8 years ago

presentday-presenttime commented 8 years ago

message.channel.permissionsOf(message.author).serialize()

gives { createInstantInvite: true, kickMembers: true, banMembers: true, managePermissions: true, manageChannel: true, manageServer: true, readMessages: true, sendMessages: true, sendTTSMessages: true, manageMessages: true, embedLinks: true, attachFiles: true, readMessageHistory: true, mentionEveryone: true, voiceConnect: true, voiceSpeak: true, voiceMuteMembers: true, voiceDeafenMembers: true, voiceMoveMembers: true, voiceUseVAD: true }

if the message author is allowed to Manage roles, even if all other permissions are false.

mnlkrs commented 8 years ago

The line that's causing this https://github.com/hydrabolt/discord.js/blob/3f47c3e5cc1e59d10febbf652ab944a0ee3a4d29/src/Structures/ChannelPermissions.js#L35-L40

abalabahaha commented 8 years ago

Old code. Should be administrator