diff options
author | dec05eba <0xdec05eba@gmail.com> | 2018-05-16 08:21:51 +0200 |
---|---|---|
committer | dec05eba <0xdec05eba@gmail.com> | 2018-05-16 08:21:54 +0200 |
commit | 6d0eace64b37098e31c20758b066d4fe23c58a5c (patch) | |
tree | f686a35ba07d7aed40094847cf9ad9e19b78429d /src | |
parent | 4254486345167d4800f4a8f2a9b84975f0a4c886 (diff) |
Remove duplicate permission checking for ADD_DATA operation
Diffstat (limited to 'src')
-rw-r--r-- | src/Database.cpp | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/Database.cpp b/src/Database.cpp index 8529811..fff74f4 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -434,19 +434,6 @@ namespace odhtdb void Database::addData(const DatabaseNode &nodeInfo, const Signature::KeyPair &userToPerformActionWith, DataView dataToAdd) { - if(!databaseStorage.isUserAllowedToAddDataInNode(*nodeInfo.getRequestHash(), userToPerformActionWith.getPublicKey())) - { - // TODO: User might have permission to perform operation, but we haven't got the packet that adds user to the group with the permission, - // or we haven't received the packet that modifies group with the permission to perform the operation. - // This also means that an user can be in a group that has permission to perform the operation and then later be removed from it, - // and remote peers would accept our request to perform operation if they haven't received the operation that removes the user from the group. - // How to handle this? - string errMsg = "User "; - errMsg += userToPerformActionWith.getPublicKey().toString(); - errMsg += " is not allowed to perform the operation: ADD_USER"; - throw PermissionDeniedException(errMsg); - } - sibs::SafeSerializer serializer; serializer.add(DATABASE_ADD_PACKET_STRUCTURE_VERSION); u64 timestampCombined = getSyncedTimestampUtc().getCombined(); |