From b7e646ec830e5b1488b5848e80a52c184e10c1b6 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 1 Mar 2014 20:02:17 -0500 Subject: [PATCH] Allow opers with chanserv/administration to use fantasy, even if they don't have the access for it --- modules/fantasy.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/fantasy.cpp b/modules/fantasy.cpp index 6a212a633..0e24b10c5 100644 --- a/modules/fantasy.cpp +++ b/modules/fantasy.cpp @@ -162,8 +162,11 @@ class Fantasy : public Module source.command = it->first; source.permission = info.permission; + AccessGroup ag = c->ci->AccessFor(u); + bool has_fantasia = ag.HasPriv("FANTASIA") || source.HasPriv("chanserv/administration"); + EventReturn MOD_RESULT; - if (c->ci->AccessFor(u).HasPriv("FANTASIA")) + if (has_fantasia) { FOREACH_RESULT(OnBotFantasy, MOD_RESULT, (source, cmd, c->ci, params)); } @@ -172,7 +175,7 @@ class Fantasy : public Module FOREACH_RESULT(OnBotNoFantasyAccess, MOD_RESULT, (source, cmd, c->ci, params)); } - if (MOD_RESULT == EVENT_STOP || !c->ci->AccessFor(u).HasPriv("FANTASIA")) + if (MOD_RESULT == EVENT_STOP || !has_fantasia) return; if (MOD_RESULT != EVENT_ALLOW && !info.permission.empty() && !source.HasCommand(info.permission))