Commit b01f4389 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix VirtualMachinesAllowed policy parsing for UI

Fix inconsistency in the code that parses this policy for the policy map
(which is used for the chrome://policy page). The code shouldn't pretend
to have the policy set (with the default value) when the enclosing proto
message is present but with the actual policy proto field unset.

Note that the fixed issue should have been a purely UI glitch - the
actual policy application wasn't affected.

BUG=chromium:800120
TEST=none

Change-Id: I32d55dc6bfe64ec8b1cac7c090028f805c91560a
Reviewed-on: https://chromium-review.googlesource.com/986096Reviewed-by: default avatarJulian Pastarmov <pastarmovj@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549849}
parent 6b44abf8
......@@ -1051,11 +1051,13 @@ void DecodeGenericPolicies(const em::ChromeDeviceSettingsProto& policy,
if (policy.has_virtual_machines_allowed()) {
const em::VirtualMachinesAllowedProto& container(
policy.virtual_machines_allowed());
policies->Set(
key::kVirtualMachinesAllowed, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD,
std::make_unique<base::Value>(container.virtual_machines_allowed()),
nullptr);
if (container.has_virtual_machines_allowed()) {
policies->Set(
key::kVirtualMachinesAllowed, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD,
std::make_unique<base::Value>(container.virtual_machines_allowed()),
nullptr);
}
}
if (policy.has_device_machine_password_change_rate()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment