From 21f0718c4ae18f565895b5cc05c4af3942d0f8e5 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 19 Apr 2019 00:39:57 +0100 Subject: Remove the 'noisy' mode for HasPrivPermission. This was only used in one place. --- src/users.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 3a6ddbc0f..827d818c3 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -195,27 +195,17 @@ bool LocalUser::HasPermission(const std::string &command) return oper->AllowedOperCommands.Contains(command); } -bool User::HasPrivPermission(const std::string &privstr, bool noisy) +bool User::HasPrivPermission(const std::string& privstr) { return true; } -bool LocalUser::HasPrivPermission(const std::string &privstr, bool noisy) +bool LocalUser::HasPrivPermission(const std::string& privstr) { if (!this->IsOper()) - { - if (noisy) - this->WriteNotice("You are not an oper"); return false; - } - - if (oper->AllowedPrivs.Contains(privstr)) - return true; - - if (noisy) - this->WriteNotice("Oper type " + oper->name + " does not have access to priv " + privstr); - return false; + return oper->AllowedPrivs.Contains(privstr); } void UserIOHandler::OnDataReady() -- cgit v1.3.1-10-gc9f91