Merge pull request #739 from MihaelaStoica/CA-188017

CA-188017: When checking credentials on the Health Check dialog, disp…
This commit is contained in:
Gabor Apati-Nagy 2015-11-11 13:04:32 +00:00
commit 54aa8ae239
3 changed files with 21 additions and 0 deletions

View File

@ -335,6 +335,15 @@ namespace XenAdmin.Dialogs.HealthCheck
if (elevatedSession != null && (elevatedSession.IsLocalSuperuser || SessionAuthorized(elevatedSession, Role.ValidRoleList("pool.set_health_check_config", connection))))
passedRbacChecks = true;
}
catch (Failure f)
{
if (f.ErrorDescription.Count > 0 && f.ErrorDescription[0] == Failure.RBAC_PERMISSION_DENIED)
{
// we use a different error message here from the standard one in friendly names
throw new Exception(Messages.HEALTH_CHECK_USER_HAS_NO_PERMISSION_TO_CONNECT);
}
throw;
}
finally
{
if (elevatedSession != null)

View File

@ -16265,6 +16265,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to This user is not authorized to access this server..
/// </summary>
public static string HEALTH_CHECK_USER_HAS_NO_PERMISSION_TO_CONNECT {
get {
return ResourceManager.GetString("HEALTH_CHECK_USER_HAS_NO_PERMISSION_TO_CONNECT", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This user is not authorized to perform Health Check operations..
/// </summary>

View File

@ -5749,6 +5749,9 @@ Click Configure HA to alter the settings displayed below.</value>
<data name="HEALTH_CHECK_AUTHENTICATION_INVALID_CREDENTIALS" xml:space="preserve">
<value>Invalid username or password. Please try again.</value>
</data>
<data name="HEALTH_CHECK_USER_HAS_NO_PERMISSION_TO_CONNECT" xml:space="preserve">
<value>This user is not authorized to access this server.</value>
</data>
<data name="HEALTH_CHECK_USER_NOT_AUTHORIZED" xml:space="preserve">
<value>This user is not authorized to perform Health Check operations.</value>
</data>