Commit 2957e4e3 authored by Tim Zheng's avatar Tim Zheng Committed by Commit Bot

Check 2 new Crostini policies.

BUG=chromium:879737
TEST=Manually tested on an eve device with YAPS.

Change-Id: I9a99d5a76178ba71fcd4017c6e43f1fad0fc77b8
Reviewed-on: https://chromium-review.googlesource.com/1208827
Commit-Queue: Tim Zheng <timzheng@chromium.org>
Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589611}
parent 79f8b4dc
......@@ -215,6 +215,15 @@ bool IsCrostiniAllowedForProfile(Profile* profile) {
if (profile && (profile->IsChild() || profile->IsLegacySupervised())) {
return false;
}
if (!profile->GetPrefs()->GetBoolean(
crostini::prefs::kUserCrostiniAllowedByPolicy)) {
return false;
}
const user_manager::User* user =
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
if (!user->IsAffiliated() && !IsUnaffiliatedCrostiniAllowedByPolicy()) {
return false;
}
return virtual_machines::AreVirtualMachinesAllowedByVersionAndChannel() &&
virtual_machines::AreVirtualMachinesAllowedByPolicy() &&
base::FeatureList::IsEnabled(features::kCrostini);
......
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