aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <0xdec05eba@gmail.com>2018-07-18 19:21:15 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-07-18 19:21:18 +0200
commit6ac05b4598f4b9133384bb586b50a9c1b2753796 (patch)
tree7468b7aefc4443626fe90eafd849acf5f10d523c /include
parent92217f9654284d2b3db4c4e17c154658a2125458 (diff)
Add method to get user lowest permission level
Diffstat (limited to 'include')
-rw-r--r--include/odhtdb/Database.hpp3
-rw-r--r--include/odhtdb/DatabaseStorage.hpp2
2 files changed, 5 insertions, 0 deletions
diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp
index 85207a0..372b19c 100644
--- a/include/odhtdb/Database.hpp
+++ b/include/odhtdb/Database.hpp
@@ -209,6 +209,9 @@ namespace odhtdb
MapHash<StoredNodeInfo> getStoredNodeUserInfoDecrypted(const std::string &username, const std::string &password) const;
std::vector<OwnedByteArray> getUserGroups(const Hash &nodeHash, const Signature::PublicKey &userPublicKey) const;
+
+ // Returns -1 on failure
+ int getUserLowestPermissionLevel(const Hash &nodeHash, const Signature::PublicKey &userPublicKey) const;
std::future<size_t> receiveCustomMessage(const dht::InfoHash &requestKey, ReceiveCustomMessageCallbackFunc callbackFunc);
diff --git a/include/odhtdb/DatabaseStorage.hpp b/include/odhtdb/DatabaseStorage.hpp
index 757fbfd..b84635c 100644
--- a/include/odhtdb/DatabaseStorage.hpp
+++ b/include/odhtdb/DatabaseStorage.hpp
@@ -114,6 +114,8 @@ namespace odhtdb
bool isUserAllowedToAddDataInNode(const Hash &nodeHash, const Signature::PublicKey &userPublicKey) const;
bool isUserAllowedToAddUserToGroupInNode(const Hash &nodeHash, const Signature::PublicKey &userPublicKey, const DataView &groupToAddUserTo) const;
+ // Returns -1 on failure
+ int getUserLowestPermissionLevel(const Hash &nodeHash, const Signature::PublicKey &userPublicKey) const;
// Throws DatabaseStorageNotFound if user doesn't exist in node
u64 getUserActionCounter(const Hash &nodeHash, const Signature::PublicKey &userPublicKey) const;