From c822c87af28f2950173a251dddd2720806ef0c9e Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Wed, 2 Aug 2023 11:44:05 +0100 Subject: [PATCH] Renamed method to match C# conventions. Signed-off-by: Konstantina Chremmou --- XenAdmin/Actions/GUIActions/ExternalPluginAction.cs | 6 +++--- XenAdmin/Commands/HACommand.cs | 4 ++-- XenAdmin/Controls/ConsolePanel.cs | 4 ++-- XenAdmin/Dialogs/RoleElevationDialog.cs | 4 ++-- XenModel/Actions/AsyncAction.cs | 4 ++-- XenModel/Actions/Pool/AddHostToPoolAction.cs | 2 +- XenModel/XenAPI-Extensions/Failure.cs | 2 +- XenModel/XenAPI-Extensions/Role.cs | 2 +- XenModel/XenAPI-Extensions/Session.cs | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/XenAdmin/Actions/GUIActions/ExternalPluginAction.cs b/XenAdmin/Actions/GUIActions/ExternalPluginAction.cs index 5eb55226b..e53ff1e7a 100644 --- a/XenAdmin/Actions/GUIActions/ExternalPluginAction.cs +++ b/XenAdmin/Actions/GUIActions/ExternalPluginAction.cs @@ -194,8 +194,8 @@ namespace XenAdmin.Actions List rolesAbleToCompleteAction; bool ableToCompleteAction = Role.CanPerform(methodsToCheck, xenConnection, out rolesAbleToCompleteAction); - log.DebugFormat("Roles able to complete action: {0}", Role.FriendlyCSVRoleList(rolesAbleToCompleteAction)); - log.DebugFormat("Subject {0} has roles: {1}", xenConnection.Session.UserLogName(), Role.FriendlyCSVRoleList(xenConnection.Session.Roles)); + log.DebugFormat("Roles able to complete action: {0}", Role.FriendlyCsvRoleList(rolesAbleToCompleteAction)); + log.DebugFormat("Subject {0} has roles: {1}", xenConnection.Session.UserLogName(), Role.FriendlyCsvRoleList(xenConnection.Session.Roles)); if (ableToCompleteAction) { @@ -206,7 +206,7 @@ namespace XenAdmin.Actions // Can't run on this connection, bail out string desc = string.Format(FriendlyErrorNames.RBAC_PERMISSION_DENIED_FRIENDLY_CONNECTION, xenConnection.Session.FriendlyRoleDescription(), - Role.FriendlyCSVRoleList(rolesAbleToCompleteAction), + Role.FriendlyCsvRoleList(rolesAbleToCompleteAction), xenConnection.Name); throw new Exception(desc); } diff --git a/XenAdmin/Commands/HACommand.cs b/XenAdmin/Commands/HACommand.cs index 896958250..bbbe754cd 100644 --- a/XenAdmin/Commands/HACommand.cs +++ b/XenAdmin/Commands/HACommand.cs @@ -110,8 +110,8 @@ namespace XenAdmin.Commands else if (!Role.CanPerform(HA_PERMISSION_CHECKS, pool.Connection, out _)) { var msg = string.Format(Messages.RBAC_HA_CONFIGURE_WARNING, - Role.FriendlyCSVRoleList(Role.ValidRoleList(HA_PERMISSION_CHECKS, pool.Connection)), - Role.FriendlyCSVRoleList(pool.Connection.Session.Roles)); + Role.FriendlyCsvRoleList(Role.ValidRoleList(HA_PERMISSION_CHECKS, pool.Connection)), + Role.FriendlyCsvRoleList(pool.Connection.Session.Roles)); using (var dlg = new ErrorDialog(msg)) dlg.ShowDialog(Parent); diff --git a/XenAdmin/Controls/ConsolePanel.cs b/XenAdmin/Controls/ConsolePanel.cs index e75a3fdb6..d0384e72b 100644 --- a/XenAdmin/Controls/ConsolePanel.cs +++ b/XenAdmin/Controls/ConsolePanel.cs @@ -127,8 +127,8 @@ namespace XenAdmin.Controls string msg = allowedRoles.Count == 1 ? Messages.RBAC_CONSOLE_WARNING_ONE : Messages.RBAC_CONSOLE_WARNING_MANY; lableRbacWarning.Text = string.Format(msg, - Role.FriendlyCSVRoleList(source.Connection.Session.Roles), - Role.FriendlyCSVRoleList(allowedRoles)); + Role.FriendlyCsvRoleList(source.Connection.Session.Roles), + Role.FriendlyCsvRoleList(allowedRoles)); tableLayoutPanelRbac.Visible = true; return; diff --git a/XenAdmin/Dialogs/RoleElevationDialog.cs b/XenAdmin/Dialogs/RoleElevationDialog.cs index 258ba5580..5bbae58f3 100644 --- a/XenAdmin/Dialogs/RoleElevationDialog.cs +++ b/XenAdmin/Dialogs/RoleElevationDialog.cs @@ -63,9 +63,9 @@ namespace XenAdmin.Dialogs InitializeComponent(); UserDetails ud = session.CurrentUserDetails; labelCurrentUserValue.Text = ud?.UserDisplayName ?? ud?.UserName ?? Messages.UNKNOWN_AD_USER; - labelCurrentRoleValue.Text = Role.FriendlyCSVRoleList(session.Roles); + labelCurrentRoleValue.Text = Role.FriendlyCsvRoleList(session.Roles); authorizedRoles.Sort((r1, r2) => r2.CompareTo(r1)); - labelRequiredRoleValue.Text = Role.FriendlyCSVRoleList(authorizedRoles); + labelRequiredRoleValue.Text = Role.FriendlyCsvRoleList(authorizedRoles); labelServerValue.Text = Helpers.GetName(connection); labelServer.Text = Helpers.IsPool(connection) ? Messages.POOL_COLON : Messages.SERVER_COLON; diff --git a/XenModel/Actions/AsyncAction.cs b/XenModel/Actions/AsyncAction.cs index 5f4eee92f..b88263fe0 100644 --- a/XenModel/Actions/AsyncAction.cs +++ b/XenModel/Actions/AsyncAction.cs @@ -422,8 +422,8 @@ namespace XenAdmin.Actions bool ableToCompleteAction = Role.CanPerform(rbacMethodList, Connection, out var allowedRoles); - log.DebugFormat("Roles able to complete action: {0}", Role.FriendlyCSVRoleList(allowedRoles)); - log.DebugFormat("Subject {0} has roles: {1}", Connection.Session.UserLogName(), Role.FriendlyCSVRoleList(Connection.Session.Roles)); + log.DebugFormat("Roles able to complete action: {0}", Role.FriendlyCsvRoleList(allowedRoles)); + log.DebugFormat("Subject {0} has roles: {1}", Connection.Session.UserLogName(), Role.FriendlyCsvRoleList(Connection.Session.Roles)); if (ableToCompleteAction) { diff --git a/XenModel/Actions/Pool/AddHostToPoolAction.cs b/XenModel/Actions/Pool/AddHostToPoolAction.cs index ec4b54865..4f8bf99eb 100644 --- a/XenModel/Actions/Pool/AddHostToPoolAction.cs +++ b/XenModel/Actions/Pool/AddHostToPoolAction.cs @@ -104,7 +104,7 @@ namespace XenAdmin.Actions var output = string.Join(", ", sessions.Select(s => string.Format(Messages.ROLE_ON_CONNECTION, s.FriendlyRoleDescription(), Helpers.GetName(s.Connection).Ellipsise(50)))); - throw new Failure(Failure.RBAC_PERMISSION_DENIED_FRIENDLY, output, Role.FriendlyCSVRoleList(authRoles)); + throw new Failure(Failure.RBAC_PERMISSION_DENIED_FRIENDLY, output, Role.FriendlyCsvRoleList(authRoles)); } throw; diff --git a/XenModel/XenAPI-Extensions/Failure.cs b/XenModel/XenAPI-Extensions/Failure.cs index 91a831338..ebeb6d5e1 100644 --- a/XenModel/XenAPI-Extensions/Failure.cs +++ b/XenModel/XenAPI-Extensions/Failure.cs @@ -108,7 +108,7 @@ namespace XenAPI // Current Role(s) failure.ErrorDescription[1] = Session.FriendlyRoleDescription(); // Authorized roles - failure.ErrorDescription[2] = Role.FriendlyCSVRoleList(authRoles); + failure.ErrorDescription[2] = Role.FriendlyCsvRoleList(authRoles); failure.ParseExceptionMessage(); } } diff --git a/XenModel/XenAPI-Extensions/Role.cs b/XenModel/XenAPI-Extensions/Role.cs index 1fe812a65..aeac6af07 100644 --- a/XenModel/XenAPI-Extensions/Role.cs +++ b/XenModel/XenAPI-Extensions/Role.cs @@ -104,7 +104,7 @@ namespace XenAPI /// /// Takes a list of role objects and returns as a comma separated friendly string /// - public static string FriendlyCSVRoleList(List roles) + public static string FriendlyCsvRoleList(List roles) { if (roles == null) return ""; diff --git a/XenModel/XenAPI-Extensions/Session.cs b/XenModel/XenAPI-Extensions/Session.cs index cd815d5c7..64d3dca14 100644 --- a/XenModel/XenAPI-Extensions/Session.cs +++ b/XenModel/XenAPI-Extensions/Session.cs @@ -149,7 +149,7 @@ namespace XenAPI if (IsLocalSuperuser || XenAdmin.Core.Helpers.GetCoordinator(Connection).external_auth_type != Auth.AUTH_TYPE_AD) return Messages.AD_LOCAL_ROOT_ACCOUNT; - return Role.FriendlyCSVRoleList(Roles); + return Role.FriendlyCsvRoleList(Roles); } ///