summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-04-16 20:28:52 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-04-16 20:28:52 +0000
commitfc4f89e0798ede80ce5b26b2b28423390e70db08 (patch)
treeb8208e30637c096f17702e79e375e4c9e0c4f574 /src
parent723e3f2ce02865870b2a6d7ccb999eb693ac87ad (diff)
Add Command::SetPermission member to centralise access checking. Remove duplicated comments at the same time.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2282 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/command.cpp37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 752ea370c..ae2cae740 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2008-2009 Robin Burchell <w00t@inspircd.org>
+ * Copyright (C) 2008-2009 Anope Team <team@anope.org>
+ *
+ * Please read COPYING and README for further details.
+ *
+ *
+ * $Id$
+ *
+ */
#include "services.h"
#include "modules.h"
@@ -24,44 +34,29 @@ Command::~Command()
}
}
-/** Execute this command.
- * @param u The user executing the command.
- */
CommandReturn Command::Execute(User *u, std::vector<std::string> &) { return MOD_CONT; }
-/** Requested when the user is requesting help on this command. Help on this command should be sent to the user.
- * @param u The user requesting help
- * @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of "FOO BAR LOL")
- * @return true if help was provided to the user, false otherwise.
- */
bool Command::OnHelp(User *u, const std::string &subcommand) { return false; }
-/** Requested when the user provides bad syntax to this command (not enough params, etc).
- * @param u The user executing the command.
- */
void Command::OnSyntaxError(User *u) { }
-/** Set a certain flag on this command.
- * @param flag The CommandFlag to set on this command.
- */
void Command::SetFlag(CommandFlags flag)
{
this->flags |= flag;
}
-/** Remove a certain flag from this command.
- * @param flag The CommandFlag to unset.
- */
void Command::UnsetFlag(CommandFlags flag)
{
this->flags &= ~flag;
}
-/** Check whether a certain flag is set on this command.
- * @param flag The CommandFlag to check.
- * @return bool True if the flag is set, false else.
- */
bool Command::HasFlag(CommandFlags flag) const
{
return this->flags & flag;
}
+
+void Command::SetPermission(const std::string &reststr)
+{
+ this->permission = reststr;
+}
+