permission fix

This commit is contained in:
Mirco Wittrien 2022-04-08 10:31:22 +02:00
parent 6debf865e4
commit 781c0a83d5
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* @name BDFDB * @name BDFDB
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 2.2.5 * @version 2.2.6
* @description Required Library for DevilBro's Plugins * @description Required Library for DevilBro's Plugins
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -19,7 +19,7 @@ module.exports = (_ => {
"info": { "info": {
"name": "BDFDB", "name": "BDFDB",
"author": "DevilBro", "author": "DevilBro",
"version": "2.2.5", "version": "2.2.6",
"description": "Required Library for DevilBro's Plugins" "description": "Required Library for DevilBro's Plugins"
} }
}; };
@ -3209,7 +3209,7 @@ module.exports = (_ => {
if (!BDFDB.DiscordConstants.Permissions[permission]) BDFDB.LogUtils.warn([permission, "not found in Permissions"]); if (!BDFDB.DiscordConstants.Permissions[permission]) BDFDB.LogUtils.warn([permission, "not found in Permissions"]);
else { else {
let channel = Internal.LibraryModules.ChannelStore.getChannel(channelId); let channel = Internal.LibraryModules.ChannelStore.getChannel(channelId);
if (channel) return Internal.LibraryModules.PermissionRoleUtils.can(BDFDB.DiscordConstants.Permissions[permission], id, channel); if (channel) return Internal.LibraryModules.PermissionRoleUtils.can(BDFDB.DiscordConstants.Permissions[permission], id, channel) || Internal.LibraryModules.PermissionRoleUtils.can({permission: BDFDB.DiscordConstants.Permissions[permission], user: id, context: channel});
} }
return false; return false;
}; };

View File

@ -97,8 +97,8 @@
"NotificationSettingsUtils": {"props": ["setDesktopType", "setTTSType"]}, "NotificationSettingsUtils": {"props": ["setDesktopType", "setTTSType"]},
"NotificationUtils": {"props": ["makeTextChatNotification", "shouldNotify"]}, "NotificationUtils": {"props": ["makeTextChatNotification", "shouldNotify"]},
"PlatformUtils": {"props": ["isWindows", "isLinux"]}, "PlatformUtils": {"props": ["isWindows", "isLinux"]},
"PermissionRoleUtils": {"props": ["can", "ALLOW", "DENY"]},
"PermissionUtils": {"props": ["getChannelPermissions", "can"]}, "PermissionUtils": {"props": ["getChannelPermissions", "can"]},
"PermissionRoleUtils": {"props": ["canEveryone", "can"]},
"PreferencesContext": {"props": ["AccessibilityPreferencesContext"]}, "PreferencesContext": {"props": ["AccessibilityPreferencesContext"]},
"QueryUtils": {"props": ["AutocompleterQuerySymbols", "AutocompleterResultTypes"]}, "QueryUtils": {"props": ["AutocompleterQuerySymbols", "AutocompleterResultTypes"]},
"ReactionEmojiUtils": {"props": ["getReactionEmojiName", "getReactionEmojiName"]}, "ReactionEmojiUtils": {"props": ["getReactionEmojiName", "getReactionEmojiName"]},