CA-142255:XenCenter popup exception dialog which is unexpected

Signed-off-by: Cheng Zhang <cheng.zhang@citrix.com>
This commit is contained in:
Cheng Zhang 2014-08-29 16:50:47 +08:00
parent 7d2e113130
commit 91b56d3a9e

View File

@ -223,13 +223,16 @@ namespace XenAPI
/// <param name="validRoleList">The list of roles which can perform all the methods</param> /// <param name="validRoleList">The list of roles which can perform all the methods</param>
public static bool CanPerform(RbacMethodList apiMethodsToRoleCheck, IXenConnection connection, out List<Role> validRoleList, bool debug) public static bool CanPerform(RbacMethodList apiMethodsToRoleCheck, IXenConnection connection, out List<Role> validRoleList, bool debug)
{ {
validRoleList = ValidRoleList(apiMethodsToRoleCheck, connection, debug); if (!connection.IsConnected)
{
validRoleList = new List<Role>();
return false;
}
else
validRoleList = ValidRoleList(apiMethodsToRoleCheck, connection, debug);
if (Helpers.MidnightRideOrGreater(connection)) if (Helpers.MidnightRideOrGreater(connection))
{ {
if (!connection.IsConnected)
return false;
if (connection.Session.IsLocalSuperuser) if (connection.Session.IsLocalSuperuser)
return true; return true;