summaryrefslogtreecommitdiff
path: root/src/common/permissionmanager.hpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <mana@crushnet.org>2010-01-17 01:28:42 +0100
committerPhilipp Sehmisch <mana@crushnet.org>2010-01-17 01:28:59 +0100
commitc9c199007fb6b77f8cd13ffdb560cd18ff3c5af4 (patch)
treea6e4b3d0ab1ae7f26e3e0847ebc53b44c59a7efd /src/common/permissionmanager.hpp
parent8bf0791932c8809fe5bd85d53859b8ce6197e4ed (diff)
downloadmanaserv-c9c199007fb6b77f8cd13ffdb560cd18ff3c5af4.tar.gz
manaserv-c9c199007fb6b77f8cd13ffdb560cd18ff3c5af4.tar.bz2
manaserv-c9c199007fb6b77f8cd13ffdb560cd18ff3c5af4.tar.xz
manaserv-c9c199007fb6b77f8cd13ffdb560cd18ff3c5af4.zip
Added permission manager. Currently only used for @commands and doesn't support <deny> and <alias> yet.
Diffstat (limited to 'src/common/permissionmanager.hpp')
-rw-r--r--src/common/permissionmanager.hpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/common/permissionmanager.hpp b/src/common/permissionmanager.hpp
new file mode 100644
index 00000000..4989d0ac
--- /dev/null
+++ b/src/common/permissionmanager.hpp
@@ -0,0 +1,54 @@
+/*
+ * The Mana Server
+ * Copyright (C) 2010 The Mana World Development Team
+ *
+ * This file is part of The Mana Server.
+ *
+ * The Mana Server is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana Server is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana Server. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PERMISSIONMANAGER_HPP
+#define PERMISSIONMANAGER_HPP
+
+#include <map>
+#include <string>
+
+class Character;
+
+namespace PermissionManager
+{
+ enum Result
+ {
+ PMR_UNKNOWN,
+ PMR_DENIED,
+ PMR_ALLOWED
+ };
+ /**
+ * Loads permission file.
+ */
+ void initialize(const std::string &);
+
+ /**
+ * Reloads permission file.
+ */
+ void reload();
+
+ /**
+ * Returns if the characters account has the given permission
+ */
+ Result checkPermission(const Character* character, std::string permission);
+
+}
+
+#endif