fixup Disco -> Disco ICT

This commit is contained in:
Gary Sharp
2023-07-26 19:01:31 +10:00
parent e204ea4d5f
commit 6fcb1a1eae
68 changed files with 221 additions and 232 deletions
@@ -19,7 +19,7 @@ namespace Disco.Services.Authorization
{
if (message == null)
{
return "Your account does not have the required permission to access this Disco feature.";
return "Your account does not have the required permission to access this Disco ICT feature.";
}
else
{
@@ -44,7 +44,7 @@ namespace Disco.Services.Authorization
#region Token Accessors
internal const string RequireAuthenticationMessage = "This feature requires authentication.";
internal const string RequireDiscoAuthorizationMessage = "Your account does not have the required permission to access this feature. This feature requires your account to be included in at least one Disco Authorization Role.";
internal const string RequireDiscoAuthorizationMessage = "Your account does not have the required permission to access this feature. This feature requires your account to be included in at least one Disco ICT Authorization Role.";
internal const string RequireMessageTemplate = "Your account does not have the required permission to access this feature.\r\n";
internal const string RequireMessageSingleTemplate = RequireMessageTemplate + "This feature requires the following permission:\r\n- {0}";
internal const string RequireAllMessageTemplate = RequireMessageTemplate + "This feature requires permission for:\r\n- {0}";
+5 -5
View File
@@ -220,14 +220,14 @@ namespace Disco.Services.Authorization
{ "User.ShowFlagAssignments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.ShowFlagAssignments, (c, v) => c.User.ShowFlagAssignments = v, "Show Users Flag Assignments", "Can show flags associated with users", false) },
{ "User.ShowJobs", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.ShowJobs, (c, v) => c.User.ShowJobs = v, "Show Users Jobs", "Can show jobs associated with users", false) },
{ "ComputerAccount", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.ComputerAccount, (c, v) => c.ComputerAccount = v, "Computer Account", "Represents a computer account", true) },
{ "DiscoAdminAccount", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.DiscoAdminAccount, (c, v) => c.DiscoAdminAccount = v, "Disco Administrator Account", "Represents a Disco Administrator account", true) }
{ "DiscoAdminAccount", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.DiscoAdminAccount, (c, v) => c.DiscoAdminAccount = v, "Disco ICT Administrator Account", "Represents a Disco ICT Administrator account", true) }
};
#endregion
#region Role Claim Navigator
_claimNavigator =
new ClaimNavigatorItem("Claims", "Permissions", "Top-level node for all permissions", false, new List<IClaimNavigatorItem>() {
new ClaimNavigatorItem("Config", "Configuration", "Permissions related to Disco Configuration", false, new List<IClaimNavigatorItem>() {
new ClaimNavigatorItem("Config", "Configuration", "Permissions related to Disco ICT Configuration", false, new List<IClaimNavigatorItem>() {
new ClaimNavigatorItem("Config.DeviceBatch", "Device Batches", "Permissions related to Device Batches", false, new List<IClaimNavigatorItem>() {
new ClaimNavigatorItem("Config.DeviceBatch.Configure", false),
new ClaimNavigatorItem("Config.DeviceBatch.Create", false),
@@ -749,7 +749,7 @@ namespace Disco.Services.Authorization
#region Role Claim Constants
/// <summary>Configuration
/// <para>Permissions related to Disco Configuration</para>
/// <para>Permissions related to Disco ICT Configuration</para>
/// </summary>
public static class Config
{
@@ -1917,8 +1917,8 @@ namespace Disco.Services.Authorization
/// </summary>
public const string ComputerAccount = "ComputerAccount";
/// <summary>Disco Administrator Account
/// <para>Represents a Disco Administrator account</para>
/// <summary>Disco ICT Administrator Account
/// <para>Represents a Disco ICT Administrator account</para>
/// </summary>
public const string DiscoAdminAccount = "DiscoAdminAccount";
#endregion
@@ -14,7 +14,7 @@ using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.UserFlag;
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration
{
[ClaimDetails("Configuration", "Permissions related to Disco Configuration")]
[ClaimDetails("Configuration", "Permissions related to Disco ICT Configuration")]
public class ConfigClaims : BaseRoleClaimGroup
{
public ConfigClaims()
@@ -149,7 +149,7 @@ namespace Disco.Services.Authorization.Roles
}
/// <summary>
/// Migrates authorization role claims to conform with changes to Disco since the last release.
/// Migrates authorization role claims to conform with changes to Disco ICT since the last release.
/// Claims are only added when the meaning of an existing claim has changed (or expanded/contracted) to improve the migration experience.
/// </summary>
private static void MigrateAuthorizationRoles(DiscoDataContext Database)
@@ -19,7 +19,7 @@ namespace Disco.Services.Authorization.Roles
[ClaimDetails("Computer Account", "Represents a computer account", true)]
public bool ComputerAccount { get; set; }
[ClaimDetails("Disco Administrator Account", "Represents a Disco Administrator account", true)]
[ClaimDetails("Disco Administrator Account", "Represents a Disco ICT Administrator account", true)]
public bool DiscoAdminAccount { get; set; }
public ConfigClaims Config { get; set; }
@@ -140,7 +140,7 @@ namespace Disco.Services.Devices.Enrolment
}
}
EnrolmentLog.LogSessionProgress(sessionId, 100, "Disconnected, Starting Disco Enrolment");
EnrolmentLog.LogSessionProgress(sessionId, 100, "Disconnected, Starting Disco ICT Enrolment");
MacSecureEnrolResponse response = MacSecureEnrolResponse.FromMacEnrolResponse(MacEnrol(Database, trustedRequest, true, sessionId));
EnrolmentLog.LogSessionFinished(sessionId);
MacSecureEnrol = response;
@@ -330,7 +330,7 @@ namespace Disco.Services.Devices.Enrolment
EnrolmentLog.LogSessionProgress(sessionId, 13, "Loading Device Data");
Device RepoDevice = Database.Devices.Include("AssignedUser").Include("DeviceModel").Include("DeviceProfile").Where(d => d.SerialNumber == Request.SerialNumber).FirstOrDefault();
EnrolmentLog.LogSessionProgress(sessionId, 15, "Discovering User/Device Disco Permissions");
EnrolmentLog.LogSessionProgress(sessionId, 15, "Discovering User/Device Disco ICT Permissions");
if (isAuthenticated)
{
if (!authenticatedToken.Has(Claims.Device.Actions.EnrolDevices))
@@ -408,7 +408,7 @@ namespace Disco.Services.Devices.Enrolment
Id = (int)EventTypeIds.SessionTaskAddedDevice,
ModuleId = _ModuleId,
Name = "Task - Added Device",
Format = "Creating Disco Device {1}",
Format = "Creating Disco ICT Device {1}",
Severity = 0,
UseLive = true,
UsePersist = true,
@@ -419,7 +419,7 @@ namespace Disco.Services.Devices.Enrolment
Id = (int)EventTypeIds.SessionTaskUpdatingDevice,
ModuleId = _ModuleId,
Name = "Task - Updating Device",
Format = "Updating Disco Device {1}",
Format = "Updating Disco ICT Device {1}",
Severity = 0,
UseLive = true,
UsePersist = true,
@@ -13,7 +13,7 @@ namespace Disco.Services.Expressions.Extensions
private static SqlConnection BuildSqlConnection(string Server, string Database, string Username, string Password)
{
var dbConnectionStringBuilder = new SqlConnectionStringBuilder();
dbConnectionStringBuilder.ApplicationName = "Disco";
dbConnectionStringBuilder.ApplicationName = "Disco ICT";
dbConnectionStringBuilder.DataSource = Server;
dbConnectionStringBuilder.InitialCatalog = Database;
dbConnectionStringBuilder.MultipleActiveResultSets = true;
@@ -340,7 +340,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public string OfflineDomainJoinProvision(string ComputerSamAccountName, string OrganisationalUnit, ref ADMachineAccount MachineAccount, out string DiagnosticInformation)
{
if (MachineAccount != null && MachineAccount.IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", MachineAccount.DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", MachineAccount.DistinguishedName));
if (!IsWritable)
throw new InvalidOperationException(string.Format("The domain controller [{0}] is not writable. This action (Offline Domain Join Provision) requires a writable domain controller.", Name));
@@ -227,7 +227,7 @@ namespace Disco.Services.Interop.ActiveDirectory
private void SetNetbootGUID(ADDomainController WritableDomainController, Guid updatedNetbootGUID)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
if (NetbootGUID != updatedNetbootGUID)
{
@@ -248,7 +248,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public void SetDescription(ADDomainController WritableDomainController, string Description)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
if (this.Description != Description)
{
@@ -349,7 +349,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public void EnableAccount(ADDomainController WritableDomainController)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
if (IsDisabled)
{
@@ -377,7 +377,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public bool UpdateNetbootGUID(ADDomainController WritableDomainController, string UUID, string MACAddress)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
Guid netbootGUID = Guid.Empty;
@@ -428,7 +428,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public void MoveOrganisationalUnit(ADDomainController WritableDomainController, string NewOrganisationUnit)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
var parentDistinguishedName = ParentDistinguishedName;
@@ -296,7 +296,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public void EnableAccount(ADDomainController WritableDomainController)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
if (IsDisabled)
{
@@ -324,7 +324,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public void SetDisplayName(ADDomainController WritableDomainController, string DisplayName)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
if (this.DisplayName != DisplayName)
{
@@ -357,7 +357,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public void SetSurname(ADDomainController WritableDomainController, string Surname)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
if (this.Surname != Surname)
{
@@ -390,7 +390,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public void SetGivenName(ADDomainController WritableDomainController, string GivenName)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
if (this.GivenName != GivenName)
{
@@ -423,7 +423,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public void SetEmail(ADDomainController WritableDomainController, string Email)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
if (this.Email != Email)
{
@@ -456,7 +456,7 @@ namespace Disco.Services.Interop.ActiveDirectory
public void SetPhone(ADDomainController WritableDomainController, string Phone)
{
if (IsCriticalSystemObject)
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco refuses to modify it", DistinguishedName));
throw new InvalidOperationException(string.Format("This account {0} is a Critical System Active Directory Object and Disco ICT refuses to modify it", DistinguishedName));
if (this.Phone != Phone)
{
@@ -80,7 +80,7 @@ namespace Disco.Services.Interop.ActiveDirectory
if (group == null)
throw new ArgumentException(string.Format("The group [{0}] wasn't found", GroupId), "DevicesLinkedGroup");
if (group.GetPropertyValue<bool>("isCriticalSystemObject"))
throw new ArgumentException(string.Format("The group [{0}] is a Critical System Active Directory Object and Disco refuses to modify it", group.DistinguishedName), "DevicesLinkedGroup");
throw new ArgumentException(string.Format("The group [{0}] is a Critical System Active Directory Object and Disco ICT refuses to modify it", group.DistinguishedName), "DevicesLinkedGroup");
GroupId = group.Id;
@@ -219,7 +219,7 @@ namespace Disco.Services.Interop.ActiveDirectory
using (var adGroupEntry = ActiveDirectory.Context.RetrieveDirectoryEntry(adGroup.DistinguishedName, new string[] { "member", "isCriticalSystemObject" }))
{
if (adGroupEntry.Entry.Properties.Value<bool>("isCriticalSystemObject"))
throw new InvalidOperationException(string.Format("This group [{0}] is a Critical System Active Directory Object and Disco refuses to modify it", adGroup.DistinguishedName));
throw new InvalidOperationException(string.Format("This group [{0}] is a Critical System Active Directory Object and Disco ICT refuses to modify it", adGroup.DistinguishedName));
var adGroupEntryMembers = adGroupEntry.Entry.Properties["member"];
foreach (var item in actionItems)
@@ -369,7 +369,7 @@ namespace Disco.Services.Interop.ActiveDirectory
using (var adGroupEntry = ActiveDirectory.Context.RetrieveDirectoryEntry(adGroup.DistinguishedName, new string[] { "isCriticalSystemObject", "description", "member" }))
{
if (adGroupEntry.Entry.Properties.Value<bool>("isCriticalSystemObject"))
throw new InvalidOperationException(string.Format("This group [{0}] is a Critical System Active Directory Object and Disco refuses to modify it", adGroup.DistinguishedName));
throw new InvalidOperationException(string.Format("This group [{0}] is a Critical System Active Directory Object and Disco ICT refuses to modify it", adGroup.DistinguishedName));
// Update Description
var groupDescription = string.Format("Disco ICT: {0}", actionGroup.Item1.GroupDescription);
+1 -1
View File
@@ -262,7 +262,7 @@ namespace Disco.Services
public static string GenerateFaultDescriptionFooter(this Job j, DiscoDataContext Database, PluginFeatureManifest WarrantyProviderDefinition)
{
var versionDisco = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
return string.Format("Automation by Disco v{0}.{1}.{2:0000}.{3:0000} (Provider: {4} v{5})",
return string.Format("Automation by Disco ICT v{0}.{1}.{2:0000}.{3:0000} (Provider: {4} v{5})",
versionDisco.Major, versionDisco.Minor, versionDisco.Build, versionDisco.Revision, WarrantyProviderDefinition.Id, WarrantyProviderDefinition.PluginManifest.Version.ToString(4));
}
+1 -1
View File
@@ -148,7 +148,7 @@ namespace Disco.Services.Logging
Id = (int)EventTypeIds.Uninitialized,
ModuleId = _ModuleId,
Name = "Disco Uninitialized",
Format = "Disco Uninitialized",
Format = "Disco ICT Uninitialized",
Severity = (int)LogEventType.Severities.Information,
UseLive = false, UsePersist = true, UseDisplay = false }
};
@@ -52,7 +52,7 @@ namespace Disco.Services.Plugins.Features.UIExtension
if (uiExtResults != null && uiExtResults.Count > 0)
{
page.WriteLiteral("<!-- BEGIN: Disco UI Extensions -->");
page.WriteLiteral("<!-- BEGIN: Disco ICT UI Extensions -->");
page.WriteLiteral("\n<div id=\"layout_uiExtensions\">");
foreach (var uiExtResult in uiExtResults)
{
@@ -62,7 +62,7 @@ namespace Disco.Services.Plugins.Features.UIExtension
page.WriteLiteral(string.Format("\n<!-- END UI EXTENSION: {0} -->", extensionDescription));
}
page.WriteLiteral("\n</div>");
page.WriteLiteral("\n<!-- END: Disco UI Extensions -->");
page.WriteLiteral("\n<!-- END: Disco ICT UI Extensions -->");
}
}
+2 -2
View File
@@ -314,9 +314,9 @@ namespace Disco.Services.Plugins
throw new InvalidOperationException(string.Format("The plugin [{0} v{1}] is not compatible: {2}", pluginManifest.Id, pluginManifest.VersionFormatted, pluginIncompatible.Reason));
if (pluginManifest.HostVersionMin != null && pluginManifest.HostVersionMin > hostVersion)
throw new InvalidOperationException(string.Format("The plugin [{0} v{1}] does not support this version of Disco (Requires v{2} or greater)", pluginManifest.Id, pluginManifest.VersionFormatted, pluginManifest.HostVersionMin.ToString()));
throw new InvalidOperationException(string.Format("The plugin [{0} v{1}] does not support this version of Disco ICT (Requires v{2} or greater)", pluginManifest.Id, pluginManifest.VersionFormatted, pluginManifest.HostVersionMin.ToString()));
if (pluginManifest.HostVersionMax != null && pluginManifest.HostVersionMax < hostVersion)
throw new InvalidOperationException(string.Format("The plugin [{0} v{1}] does not support this version of Disco (Support expired as of v{2})", pluginManifest.Id, pluginManifest.VersionFormatted, pluginManifest.HostVersionMax.ToString()));
throw new InvalidOperationException(string.Format("The plugin [{0} v{1}] does not support this version of Disco ICT (Support expired as of v{2})", pluginManifest.Id, pluginManifest.VersionFormatted, pluginManifest.HostVersionMax.ToString()));
RegisterPluginAssemblyReferences(pluginManifest);
@@ -45,7 +45,7 @@ namespace Disco.Services.Plugins
File.Copy(manifestUninstallFileLocation, manifestDataUninstallFileLocation);
}
Status.Finished("Restarting Disco, please wait...", "/Config/Plugins");
Status.Finished("Restarting Disco ICT, please wait...", "/Config/Plugins");
Plugins.RestartApp(2500);
}
+1 -1
View File
@@ -88,7 +88,7 @@ namespace Disco.Services.Plugins
ExecuteTaskInternal(Status, pluginPackagesLocation, updatePlugins);
Status.Finished("Restarting Disco, please wait...", "/Config/Plugins");
Status.Finished("Restarting Disco ICT, please wait...", "/Config/Plugins");
Plugins.RestartApp(2500);
}
@@ -10,11 +10,11 @@ namespace Disco.Services.Plugins
{
private static object _startLock = new object();
public override string TaskName { get { return "Updating Disco Plugins"; } }
public override string TaskName { get { return "Updating Disco ICT Plugins"; } }
protected override void ExecuteTask()
{
Status.UpdateStatus(0, "Updating plugins after Disco update", "Starting, please wait...");
Status.UpdateStatus(0, "Updating plugins after Disco ICT update", "Starting, please wait...");
// Wait for App to Load (10 Seconds)
for (int i = 0; i < 10; i++)
@@ -33,7 +33,7 @@ namespace Disco.Services.Plugins
UpdatePluginTask.UpdateOffline(Status);
// Restart
Status.Finished("Restarting Disco, please wait...", "/");
Status.Finished("Restarting Disco ICT, please wait...", "/");
Plugins.RestartApp(2500);
}