Renamed method to match C# conventions.

Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
Konstantina Chremmou 2023-08-02 11:44:05 +01:00
parent ae81d5738a
commit c822c87af2
9 changed files with 15 additions and 15 deletions

View File

@ -194,8 +194,8 @@ namespace XenAdmin.Actions
List<Role> 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);
}

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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)
{

View File

@ -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;

View File

@ -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();
}
}

View File

@ -104,7 +104,7 @@ namespace XenAPI
/// <summary>
/// Takes a list of role objects and returns as a comma separated friendly string
/// </summary>
public static string FriendlyCSVRoleList(List<Role> roles)
public static string FriendlyCsvRoleList(List<Role> roles)
{
if (roles == null)
return "";

View File

@ -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);
}
/// <summary>