From 521b6fa111859a446fe98f3c1a53246b914c24a8 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 17 May 2021 22:54:57 +0200 Subject: [PATCH] Reverted the change with the no permission checking for server group assignments --- server/src/client/command_handler/server.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/src/client/command_handler/server.cpp b/server/src/client/command_handler/server.cpp index efa69e6..b069c45 100644 --- a/server/src/client/command_handler/server.cpp +++ b/server/src/client/command_handler/server.cpp @@ -402,6 +402,11 @@ command_result ConnectedClient::handleCommandServerGroupAddClient(Command &cmd) return command_result{error::client_invalid_id, "invalid cldbid"}; } + ClientPermissionCalculator client_permissions{target_server, target_cldbid, ClientType::CLIENT_TEAMSPEAK, 0}; + if(!permission::v2::permission_granted(client_permissions.calculate_permission(permission::i_client_needed_permission_modify_power).zero_if_unset(), this->calculate_permission(permission::i_client_permission_modify_power, 0))) { + return command_result{permission::i_client_needed_permission_modify_power}; + } + std::vector> added_groups{}; added_groups.reserve(cmd.bulkCount()); @@ -521,6 +526,11 @@ command_result ConnectedClient::handleCommandServerGroupDelClient(Command &cmd) return command_result{error::client_invalid_id, "invalid cldbid"}; } + ClientPermissionCalculator client_permissions{target_server, target_cldbid, ClientType::CLIENT_TEAMSPEAK, 0}; + if(!permission::v2::permission_granted(client_permissions.calculate_permission(permission::i_client_needed_permission_modify_power).zero_if_unset(), this->calculate_permission(permission::i_client_permission_modify_power, 0))) { + return command_result{permission::i_client_needed_permission_modify_power}; + } + std::vector> removed_groups{}; removed_groups.reserve(cmd.bulkCount());