Merge pull request #1040 from MihaelaStoica/CA-213414

CA-213414: Check feature-flag for ssl-legacy control switch
This commit is contained in:
Gabor Apati-Nagy 2016-06-27 10:13:46 +01:00 committed by GitHub
commit d18a70f6f1
2 changed files with 20 additions and 1 deletions

View File

@ -197,7 +197,7 @@ namespace XenAdmin.Dialogs
ShowTab(PoolGpuEditPage = new PoolGpuEditPage());
}
if (is_pool_or_standalone && Helpers.DundeeOrGreater(xenObject.Connection))
if (is_pool_or_standalone && !Helpers.FeatureForbidden(xenObject.Connection, Host.RestrictSslLegacySwitch))
ShowTab(SecurityEditPage = new SecurityEditPage());
if (is_network)

View File

@ -502,6 +502,25 @@ namespace XenAPI
return h._RestrictVss;
}
/// <summary>
/// For Dundee and greater hosts: the feature is restricted only if the "restrict_ssl_legacy_switch" key exists and it is true
/// For pre-Dundee hosts: the feature is restricted if the "restrict_ssl_legacy_switch" key is absent or it is true
/// </summary>
private bool _RestrictSslLegacySwitch
{
get
{
return Helpers.DundeeOrGreater(this)
? BoolKey(license_params, "restrict_ssl_legacy_switch")
: BoolKeyPreferTrue(license_params, "restrict_ssl_legacy_switch");
}
}
public static bool RestrictSslLegacySwitch(Host h)
{
return h._RestrictSslLegacySwitch;
}
public bool HasPBDTo(SR sr)
{
foreach (XenRef<PBD> pbd in PBDs)