mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
change role hasPermission to return true for administrator (#525)
* change role hasPermission to return true for administrator rather than manageRoles * add administrator to Role.serialize()
This commit is contained in:
@@ -81,6 +81,7 @@ var Role = (function () {
|
||||
manageRoles: hp(_Constants.Permissions.manageRoles),
|
||||
manageChannels: hp(_Constants.Permissions.manageChannels),
|
||||
manageServer: hp(_Constants.Permissions.manageServer),
|
||||
administrator: hp(_Constants.Permissions.administrator),
|
||||
// text
|
||||
readMessages: hp(_Constants.Permissions.readMessages),
|
||||
sendMessages: hp(_Constants.Permissions.sendMessages),
|
||||
@@ -116,7 +117,7 @@ var Role = (function () {
|
||||
}
|
||||
if (!explicit) {
|
||||
// implicit permissions allowed
|
||||
if (!!(this.permissions & _Constants.Permissions.manageRoles)) {
|
||||
if (!!(this.permissions & _Constants.Permissions.administrator)) {
|
||||
// manageRoles allowed, they have all permissions
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user