CA-213414: Check feature-flag for ssl-legacy control switch

- For Dundee and newer hosts: the feature is restricted only if the "restrict_ssl_legacy_switch" flag exists and it is set to true
- For pre-Dundee hosts: the feature is restricted if the "restrict_ssl_legacy_switch" is absent or it is present and set to true

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2016-06-24 13:16:40 +01:00
parent 7faf4fad1d
commit 05059c6f52
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)