diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 15:20:23 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 15:20:23 +0000 |
commit | e1828057c322f6e905bcc55a9b5613853d394081 (patch) | |
tree | 6a87cba8168f4ea27f8249d7d90efa48e09e9012 | |
parent | bce21304f7bc8cca0a812d76f988d60b3773b1f1 (diff) |
Add include/svsoper.h, add skeleton methods/doc.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2058 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | include/services.h | 1 | ||||
-rw-r--r-- | include/svsoper.h | 56 | ||||
-rw-r--r-- | src/svsopers.cpp | 21 |
3 files changed, 78 insertions, 0 deletions
diff --git a/include/services.h b/include/services.h index dc3f740b3..bceb829a0 100644 --- a/include/services.h +++ b/include/services.h @@ -433,6 +433,7 @@ typedef struct csmodeutil_ CSModeUtil; typedef struct session_ Session; #include "bots.h" +#include "svsoper.h" /*************************************************************************/ diff --git a/include/svsoper.h b/include/svsoper.h new file mode 100644 index 000000000..bf5c5c486 --- /dev/null +++ b/include/svsoper.h @@ -0,0 +1,56 @@ +/* + * 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$ + * + */ + +class SVSOper +{ + private: + /** The name of this opertype, e.g. "sra". + */ + std::string name; + + /** Privs that this opertype may use, e.g. 'users/auspex'. + * This *must* be std::list, see commands comment for details. + */ + std::list<std::string> privs; + + /** Commands this user may execute, e.g: + * botserv/set/ *, botserv/set/private, botserv/ * + * et cetera. + * + * This *must* be std::list, not std::map, because + * we support full globbing here. This shouldn't be a problem + * as we don't invoke it often. + */ + std::list<std::string> commands; + public: + + /** Check whether this opertype has access to run the given command string. + * @param cmdstr The string to check, e.g. botserv/set/private. + * @return True if this opertype may run the specified command, false otherwise. + */ + bool HasCommand(const std::string &cmdstr); + + /** Check whether this opertype has access to the given special permission. + * @param privstr The priv to check for, e.g. users/auspex. + * @return True if this opertype has the specified priv, false otherwise. + */ + bool HasPriv(const std::string &privstr); + + /** Add the specified command to this opertype. + * @param cmdstr The command mask to grant this opertype access to, e.g: nickserv/ *, chanserv/set/ *, botserv/set/private. + */ + void AddCommand(const std::string &cmdstr); + + /** Add the specified priv mask to this opertype. + * @param privstr The specified mask of privs to grant this opertype access to, e.g. users/auspex, users/ *, etc. + */ + void AddPriv(const std::string &privstr); +}; diff --git a/src/svsopers.cpp b/src/svsopers.cpp index 32f4f7c2d..5e59467b6 100644 --- a/src/svsopers.cpp +++ b/src/svsopers.cpp @@ -1 +1,22 @@ #include "services.h" + +bool SVSOper::HasCommand(const std::string &cmdstr) +{ + +} + +bool SVSOper::HasPriv(const std::string &privstr) +{ + +} + +void SVSOper::AddCommand(const std::string &cmdstr) +{ + +} + +void SVSOper::AddPriv(const std::string &privstr) +{ + +} + |