summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-10-18 16:52:44 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-10-18 16:52:44 +0000
commitca42e175351b6209a8e9cbd5eb92bba4f38a38ce (patch)
tree6ffdd0c0a9c5ac6d99f6d54791230bc7b956a56b
parent8ed67ec1374da80a61927498e72e0fab3de4b200 (diff)
Add skeleton of HasPrivPermission.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10660 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/users.h8
-rw-r--r--src/inspircd.cpp2
-rw-r--r--src/users.cpp7
3 files changed, 17 insertions, 0 deletions
diff --git a/include/users.h b/include/users.h
index 8fe758082..7492d31e0 100644
--- a/include/users.h
+++ b/include/users.h
@@ -788,6 +788,14 @@ class CoreExport User : public EventHandler
*/
bool HasPermission(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
+ * all operators, yet are not commands. An example might be oper override, mass messaging (/notice $*), etc.
+ *
+ * @param privstr The priv to chec, e.g. "users/override/topic". These are loaded free-form from the config file.
+ * @return True if this user has the permission in question.
+ */ bool HasPrivPermission(const std::string &privstr);
+
/** Returns true or false if a user can set a privileged user or channel mode.
* This is done by looking up their oper type from User::oper, then referencing
* this to their oper classes, and checking the modes they can set.
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 463f9d82f..c1be9812b 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -656,6 +656,8 @@ InspIRCd::InspIRCd(int argc, char** argv)
/* set up fake client again this time with the correct uid */
this->FakeClient = new User(this, "#INVALID");
this->FakeClient->SetFd(FD_MAGIC_NUMBER);
+ this->FakeClient->HasPrivPermission("users", "override/topic");
+ exit(0);
// Get XLine to do it's thing.
this->XLines->CheckELines();
diff --git a/src/users.cpp b/src/users.cpp
index 46f3eb6cc..f5af3a803 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -504,6 +504,13 @@ bool User::HasPermission(const std::string &command)
return false;
}
+
+bool User::HasPrivPermission(const std::string &privstr)
+{
+ ServerInstance->Logs->Log("CRAP", DEBUG, "Checking if I have " + privstr);
+ return true;
+}
+
bool User::AddBuffer(const std::string &a)
{
std::string::size_type start = 0;