no more everyone role in permissions
This commit is contained in:
parent
c99d2a9bba
commit
a496467585
@ -73,6 +73,9 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task PermRole([Remainder] IRole role = null)
|
public async Task PermRole([Remainder] IRole role = null)
|
||||||
{
|
{
|
||||||
|
if (role != null && role == role.Guild.EveryoneRole)
|
||||||
|
return;
|
||||||
|
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
using (var uow = DbHandler.UnitOfWork())
|
||||||
{
|
{
|
||||||
var config = uow.GuildConfigs.For(Context.Guild.Id, set => set);
|
var config = uow.GuildConfigs.For(Context.Guild.Id, set => set);
|
||||||
@ -379,6 +382,9 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task RoleCmd(CommandInfo command, PermissionAction action, [Remainder] IRole role)
|
public async Task RoleCmd(CommandInfo command, PermissionAction action, [Remainder] IRole role)
|
||||||
{
|
{
|
||||||
|
if (role == role.Guild.EveryoneRole)
|
||||||
|
return;
|
||||||
|
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
using (var uow = DbHandler.UnitOfWork())
|
||||||
{
|
{
|
||||||
var newPerm = new Permission
|
var newPerm = new Permission
|
||||||
@ -405,6 +411,9 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task RoleMdl(ModuleInfo module, PermissionAction action, [Remainder] IRole role)
|
public async Task RoleMdl(ModuleInfo module, PermissionAction action, [Remainder] IRole role)
|
||||||
{
|
{
|
||||||
|
if (role == role.Guild.EveryoneRole)
|
||||||
|
return;
|
||||||
|
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
using (var uow = DbHandler.UnitOfWork())
|
||||||
{
|
{
|
||||||
var newPerm = new Permission
|
var newPerm = new Permission
|
||||||
@ -515,6 +524,9 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task AllRoleMdls(PermissionAction action, [Remainder] IRole role)
|
public async Task AllRoleMdls(PermissionAction action, [Remainder] IRole role)
|
||||||
{
|
{
|
||||||
|
if (role == role.Guild.EveryoneRole)
|
||||||
|
return;
|
||||||
|
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
using (var uow = DbHandler.UnitOfWork())
|
||||||
{
|
{
|
||||||
var newPerm = new Permission
|
var newPerm = new Permission
|
||||||
|
Loading…
Reference in New Issue
Block a user