mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 12:30:50 +01:00
Renamed method to match C# conventions.
Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
parent
ae81d5738a
commit
c822c87af2
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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 "";
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user