summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-03-01 20:02:17 -0500
committerAdam <Adam@anope.org>2014-03-01 20:02:17 -0500
commitb7e646ec830e5b1488b5848e80a52c184e10c1b6 (patch)
tree441d3ff53572d7f3c7a3178536b231f61563d25d
parent4d54358745977b57eddb957a7e0b0a8374e15ff4 (diff)
Allow opers with chanserv/administration to use fantasy, even if they don't have the access for it
-rw-r--r--modules/fantasy.cpp7
1 files 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))