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());