diff options
author | Peter Powell <petpow@saberuk.com> | 2019-04-19 09:30:45 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-04-19 10:05:06 +0100 |
commit | 2cd6efcc64458c7b5c33529eb58fe00b7bc5e4ef (patch) | |
tree | 2eb63c905f6b66f1318db342f4952e0244ea9a0d | |
parent | 21f0718c4ae18f565895b5cc05c4af3942d0f8e5 (diff) |
Rename HasPermission to HasCommandPermission.
-rw-r--r-- | include/users.h | 4 | ||||
-rw-r--r-- | src/command_parse.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_operlog.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/include/users.h b/include/users.h index d130aec1d..dc7da40fe 100644 --- a/include/users.h +++ b/include/users.h @@ -456,7 +456,7 @@ class CoreExport User : public Extensible * @param command A command (should be all CAPS) * @return True if this user can execute the command */ - virtual bool HasPermission(const std::string &command); + virtual bool HasCommandPermission(const std::string& command); /** Returns true if a user has a given permission. * This is used to check whether or not users may perform certain actions which admins may not wish to give to @@ -832,7 +832,7 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node<Local * @param command A command (should be all CAPS) * @return True if this user can execute the command */ - bool HasPermission(const std::string &command) CXX11_OVERRIDE; + bool HasCommandPermission(const std::string& command) CXX11_OVERRIDE; /** Returns true if a user has a given permission. * This is used to check whether or not users may perform certain actions which admins may not wish to give to diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 533c7e281..57db5d496 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -139,7 +139,7 @@ CmdResult CommandParser::CallHandler(const std::string& commandname, const Comma if (user->IsModeSet(n->second->flags_needed)) { /* if user has the flags, and now has the permissions, go ahead */ - if (user->HasPermission(commandname)) + if (user->HasCommandPermission(commandname)) bOkay = true; } } @@ -257,7 +257,7 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman return; } - if (!user->HasPermission(command)) + if (!user->HasCommandPermission(command)) { user->CommandFloodPenalty += failpenalty; user->WriteNumeric(ERR_NOPRIVILEGES, InspIRCd::Format("Permission Denied - Oper type %s does not have access to command %s", diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index b64e18870..ffce7ebba 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -47,7 +47,7 @@ class ModuleOperLog : public Module if (!validated) return MOD_RES_PASSTHRU; - if ((user->IsOper()) && (user->HasPermission(command))) + if ((user->IsOper()) && (user->HasCommandPermission(command))) { Command* thiscommand = ServerInstance->Parser.GetHandler(command); if ((thiscommand) && (thiscommand->flags_needed == 'o')) diff --git a/src/users.cpp b/src/users.cpp index 827d818c3..38c8ed7f3 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -179,12 +179,12 @@ bool LocalUser::HasModePermission(const ModeHandler* mh) const * allowing remote kills, etc - but if they have access to the src, they most likely have * access to the conf - so it's an end to a means either way. */ -bool User::HasPermission(const std::string&) +bool User::HasCommandPermission(const std::string&) { return true; } -bool LocalUser::HasPermission(const std::string &command) +bool LocalUser::HasCommandPermission(const std::string& command) { // are they even an oper at all? if (!this->IsOper()) |