diff options
author | Adam <Adam@anope.org> | 2015-10-27 18:57:37 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2015-10-27 18:58:48 -0400 |
commit | 64dac60071fab652745a6e7a06cf6b7bdbbd3625 (patch) | |
tree | f8f30161150451672b381f6370a8fdcab654bbb8 /modules/commands/cs_access.cpp | |
parent | 162fdbe5815bbdf187f549fefac94ff476d72e62 (diff) | |
parent | 830361e97d03c74e54cb1cf1bbf329dffdeb66f7 (diff) |
Merge branch '2.0' into 2.1
Diffstat (limited to 'modules/commands/cs_access.cpp')
-rw-r--r-- | modules/commands/cs_access.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 982d5763f..f8ecc6c38 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -704,7 +704,7 @@ class CommandCSLevels : public Command { const Anope::string &what = params[2]; - /* Don't allow disabling of the founder level. It would be hard to change it back if you dont have access to use this command */ + /* Don't allow disabling of the founder level. It would be hard to change it back if you don't have access to use this command */ if (what.equals_ci("FOUNDER")) { source.Reply(_("You can not disable the founder privilege because it would be impossible to reenable it at a later time.")); @@ -804,6 +804,14 @@ class CommandCSLevels : public Command return; } + bool has_access = false; + if (source.HasPriv("chanserv/access/modify")) + has_access = true; + else if (cmd.equals_ci("LIST") && source.HasPriv("chanserv/access/list")) + has_access = true; + else if (source.AccessFor(ci).HasPriv("FOUNDER")) + has_access = true; + /* If SET, we want two extra parameters; if DIS[ABLE] or FOUNDER, we want only * one; else, we want none. */ @@ -813,7 +821,7 @@ class CommandCSLevels : public Command return; } - if (!source.AccessFor(ci).HasPriv("FOUNDER") && !source.HasPriv("chanserv/access/modify")) + if (!has_access) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "FOUNDER", ci->GetName()); return; |