From a496467585ecc64546f877d2dc5fdc99ba4eb611 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 4 Jan 2017 17:06:22 +0100 Subject: [PATCH] no more everyone role in permissions --- src/NadekoBot/Modules/Permissions/Permissions.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/NadekoBot/Modules/Permissions/Permissions.cs b/src/NadekoBot/Modules/Permissions/Permissions.cs index d2b282aa..33d8a27e 100644 --- a/src/NadekoBot/Modules/Permissions/Permissions.cs +++ b/src/NadekoBot/Modules/Permissions/Permissions.cs @@ -73,6 +73,9 @@ namespace NadekoBot.Modules.Permissions [RequireContext(ContextType.Guild)] public async Task PermRole([Remainder] IRole role = null) { + if (role != null && role == role.Guild.EveryoneRole) + return; + using (var uow = DbHandler.UnitOfWork()) { var config = uow.GuildConfigs.For(Context.Guild.Id, set => set); @@ -379,6 +382,9 @@ namespace NadekoBot.Modules.Permissions [RequireContext(ContextType.Guild)] public async Task RoleCmd(CommandInfo command, PermissionAction action, [Remainder] IRole role) { + if (role == role.Guild.EveryoneRole) + return; + using (var uow = DbHandler.UnitOfWork()) { var newPerm = new Permission @@ -405,6 +411,9 @@ namespace NadekoBot.Modules.Permissions [RequireContext(ContextType.Guild)] public async Task RoleMdl(ModuleInfo module, PermissionAction action, [Remainder] IRole role) { + if (role == role.Guild.EveryoneRole) + return; + using (var uow = DbHandler.UnitOfWork()) { var newPerm = new Permission @@ -515,6 +524,9 @@ namespace NadekoBot.Modules.Permissions [RequireContext(ContextType.Guild)] public async Task AllRoleMdls(PermissionAction action, [Remainder] IRole role) { + if (role == role.Guild.EveryoneRole) + return; + using (var uow = DbHandler.UnitOfWork()) { var newPerm = new Permission