Reverted the change with the no permission checking for server group assignments

This commit is contained in:
WolverinDEV 2021-05-17 22:54:57 +02:00
parent bebcb9bfb2
commit 521b6fa111

View File

@ -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<std::shared_ptr<groups::ServerGroup>> 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<std::shared_ptr<groups::ServerGroup>> removed_groups{};
removed_groups.reserve(cmd.bulkCount());