3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix some invalid permission checks

This commit is contained in:
Dragory 2019-04-13 03:27:29 +03:00
parent fbcf5d7cb8
commit 5ce3e496c3
2 changed files with 10 additions and 10 deletions

View file

@ -373,7 +373,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// The moderator who did the action is the message author or, if used, the specified --mod
let mod = msg.member;
if (args.mod) {
if (!this.hasPermission("act_as_other", { message: msg })) {
if (!this.hasPermission("can_act_as_other", { message: msg })) {
msg.channel.createMessage(errorMessage("No permission for --mod"));
return;
}
@ -441,7 +441,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// The moderator who did the action is the message author or, if used, the specified --mod
let mod = msg.member;
if (args.mod) {
if (!this.hasPermission("act_as_other", { message: msg })) {
if (!this.hasPermission("can_act_as_other", { message: msg })) {
msg.channel.createMessage(errorMessage("No permission for --mod"));
return;
}
@ -574,7 +574,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// The moderator who did the action is the message author or, if used, the specified --mod
let mod = msg.member;
if (args.mod) {
if (!this.hasPermission("act_as_other", { message: msg })) {
if (!this.hasPermission("can_act_as_other", { message: msg })) {
msg.channel.createMessage(errorMessage("No permission for --mod"));
return;
}
@ -659,7 +659,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// The moderator who did the action is the message author or, if used, the specified --mod
let mod = msg.member;
if (args.mod) {
if (!this.hasPermission("act_as_other", { message: msg })) {
if (!this.hasPermission("can_act_as_other", { message: msg })) {
msg.channel.createMessage(errorMessage("No permission for --mod"));
return;
}
@ -729,7 +729,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// The moderator who did the action is the message author or, if used, the specified --mod
let mod = msg.member;
if (args.mod) {
if (!this.hasPermission("act_as_other", { message: msg })) {
if (!this.hasPermission("can_act_as_other", { message: msg })) {
msg.channel.createMessage(errorMessage("No permission for --mod"));
return;
}
@ -799,7 +799,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// The moderator who did the action is the message author or, if used, the specified --mod
let mod = msg.member;
if (args.mod) {
if (!this.hasPermission("act_as_other", { message: msg })) {
if (!this.hasPermission("can_act_as_other", { message: msg })) {
msg.channel.createMessage(errorMessage("No permission for --mod"));
return;
}
@ -851,7 +851,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// The moderator who did the action is the message author or, if used, the specified --mod
let mod = msg.member;
if (args.mod) {
if (!this.hasPermission("act_as_other", { message: msg })) {
if (!this.hasPermission("can_act_as_other", { message: msg })) {
msg.channel.createMessage(errorMessage("No permission for --mod"));
return;
}
@ -905,7 +905,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// The moderator who did the action is the message author or, if used, the specified --mod
let mod = msg.member;
if (args.mod) {
if (!this.hasPermission("act_as_other", { message: msg })) {
if (!this.hasPermission("can_act_as_other", { message: msg })) {
msg.channel.createMessage(errorMessage("No permission for --mod"));
return;
}
@ -1046,7 +1046,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// The moderator who did the action is the message author or, if used, the specified --mod
let mod = msg.member;
if (args.mod) {
if (!this.hasPermission("act_as_other", { message: msg })) {
if (!this.hasPermission("can_act_as_other", { message: msg })) {
msg.channel.createMessage(errorMessage("No permission for --mod"));
return;
}

View file

@ -204,7 +204,7 @@ export class TagsPlugin extends ZeppelinPlugin<ITagsPluginConfig> {
async onMessageCreate(msg: SavedMessage) {
const member = this.guild.members.get(msg.user_id);
if (!this.hasPermission("use", { member, channelId: msg.channel_id })) return;
if (!this.hasPermission("can_use", { member, channelId: msg.channel_id })) return;
if (!msg.data.content) return;
if (msg.is_bot) return;