Inheritance: BaseRoleClaimGroup
Example #1
0
        internal static RoleToken FromAuthorizationRole(AuthorizationRole Role, RoleClaims Claims)
        {
            string[] sg = (Role.SubjectIds == null ? new string[0] : Role.SubjectIds.Split(',').ToArray());

            return new RoleToken()
            {
                Role = Role,
                SubjectIdHashes = new HashSet<string>(sg, StringComparer.OrdinalIgnoreCase),
                SubjectIds = sg.ToList(),
                Claims = Claims
            };
        }
Example #2
0
 public IClaimNavigatorItem BuildClaimTree(RoleClaims RoleClaims)
 {
     return new ClaimNavigatorItem()
         {
             Key = this.Key,
             Name = this.Name,
             Description = this.Description,
             Hidden = this.Hidden,
             accessor = this.accessor,
             Value = this.accessor == null ? (bool?)null : this.accessor(RoleClaims),
             Children = this.Children == null ? null : this.Children.Cast<ClaimNavigatorItem>().Select(c => c.BuildClaimTree(RoleClaims)).ToList()
         };
 }
Example #3
0
		public static RoleClaims AdministratorClaims() {
			var c = new RoleClaims();
#region Set All Administrator Claims
			c.Config.DeviceCertificate.DownloadCertificates = true;
			c.Config.Enrolment.Configure = true;
			c.Config.Enrolment.DownloadBootstrapper = true;
			c.Config.Enrolment.Show = true;
			c.Config.Enrolment.ShowStatus = true;
			c.Config.DeviceBatch.Configure = true;
			c.Config.DeviceBatch.Create = true;
			c.Config.DeviceBatch.Delete = true;
			c.Config.DeviceBatch.Show = true;
			c.Config.DeviceBatch.ShowTimeline = true;
			c.Config.DeviceModel.ConfigureComponents = true;
			c.Config.DeviceModel.Configure = true;
			c.Config.DeviceModel.Delete = true;
			c.Config.DeviceModel.Show = true;
			c.Config.DeviceProfile.ConfigureComputerNameTemplate = true;
			c.Config.DeviceProfile.ConfigureDefaults = true;
			c.Config.DeviceProfile.Configure = true;
			c.Config.DeviceProfile.Create = true;
			c.Config.DeviceProfile.Delete = true;
			c.Config.DeviceProfile.Show = true;
			c.Config.DocumentTemplate.BulkGenerate = true;
			c.Config.DocumentTemplate.ConfigureFilterExpression = true;
			c.Config.DocumentTemplate.Configure = true;
			c.Config.DocumentTemplate.Create = true;
			c.Config.DocumentTemplate.Delete = true;
			c.Config.DocumentTemplate.UndetectedPages = true;
			c.Config.DocumentTemplate.ShowStatus = true;
			c.Config.DocumentTemplate.Show = true;
			c.Config.DocumentTemplate.Upload = true;
			c.Config.Logging.Show = true;
			c.Config.Plugin.Configure = true;
			c.Config.Plugin.InstallLocal = true;
			c.Config.Plugin.Install = true;
			c.Config.Plugin.Show = true;
			c.Config.Plugin.Uninstall = true;
			c.Config.System.ConfigureActiveDirectory = true;
			c.Config.System.ConfigureProxy = true;
			c.Config.System.Show = true;
			c.Config.Organisation.ConfigureAddresses = true;
			c.Config.Organisation.ConfigureLogo = true;
			c.Config.Organisation.ConfigureMultiSiteMode = true;
			c.Config.Organisation.ConfigureName = true;
			c.Config.Organisation.Show = true;
			c.Config.JobPreferences.Configure = true;
			c.Config.JobPreferences.Show = true;
			c.Config.JobQueue.Configure = true;
			c.Config.JobQueue.Create = true;
			c.Config.JobQueue.Delete = true;
			c.Config.JobQueue.Show = true;
			c.Config.UserFlag.Configure = true;
			c.Config.UserFlag.Create = true;
			c.Config.UserFlag.Delete = true;
			c.Config.UserFlag.Show = true;
			c.Config.Show = true;
			c.Job.Lists.AllOpen = true;
			c.Job.Lists.AwaitingFinanceAgreementBreach = true;
			c.Job.Lists.AwaitingFinanceCharge = true;
			c.Job.Lists.AwaitingFinanceInsuranceProcessing = true;
			c.Job.Lists.AwaitingFinance = true;
			c.Job.Lists.AwaitingFinancePayment = true;
			c.Job.Lists.AwaitingTechnicianAction = true;
			c.Job.Lists.AwaitingUserAction = true;
			c.Job.Lists.DevicesAwaitingRepair = true;
			c.Job.Lists.DevicesReadyForReturn = true;
			c.Job.Lists.JobQueueLists = true;
			c.Job.Lists.Locations = true;
			c.Job.Lists.LongRunningJobs = true;
			c.Job.Lists.MyJobs = true;
			c.Job.Lists.MyJobsOrphaned = true;
			c.Job.Lists.RecentlyClosed = true;
			c.Job.Lists.StaleJobs = true;
			c.Job.Actions.AddAttachments = true;
			c.Job.Actions.AddLogs = true;
			c.Job.Actions.AddAnyQueues = true;
			c.Job.Actions.AddOwnQueues = true;
			c.Job.Actions.Close = true;
			c.Job.Actions.ConvertHWarToHNWar = true;
			c.Job.Actions.Create = true;
			c.Job.Actions.Delete = true;
			c.Job.Actions.ForceClose = true;
			c.Job.Actions.GenerateDocuments = true;
			c.Job.Actions.LogRepair = true;
			c.Job.Actions.LogWarranty = true;
			c.Job.Actions.RemoveAnyAttachments = true;
			c.Job.Actions.RemoveAnyLogs = true;
			c.Job.Actions.RemoveAnyQueues = true;
			c.Job.Actions.RemoveOwnQueues = true;
			c.Job.Actions.RemoveOwnAttachments = true;
			c.Job.Actions.RemoveOwnLogs = true;
			c.Job.Actions.Reopen = true;
			c.Job.Actions.UpdateSubTypes = true;
			c.Job.Properties.WarrantyProperties.ExternalCompletedDate = true;
			c.Job.Properties.WarrantyProperties.ExternalLoggedDate = true;
			c.Job.Properties.WarrantyProperties.ExternalName = true;
			c.Job.Properties.WarrantyProperties.ExternalReference = true;
			c.Job.Properties.WarrantyProperties.ProviderDetails = true;
			c.Job.Properties.WarrantyProperties.WarrantyCompleted = true;
			c.Job.Properties.NonWarrantyProperties.AccountingChargeAdded = true;
			c.Job.Properties.NonWarrantyProperties.AccountingChargePaid = true;
			c.Job.Properties.NonWarrantyProperties.AccountingChargeRequired = true;
			c.Job.Properties.NonWarrantyProperties.AddComponents = true;
			c.Job.Properties.NonWarrantyProperties.EditComponents = true;
			c.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent = true;
			c.Job.Properties.NonWarrantyProperties.InsuranceDetails = true;
			c.Job.Properties.NonWarrantyProperties.InvoiceReceived = true;
			c.Job.Properties.NonWarrantyProperties.IsInsuranceClaim = true;
			c.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised = true;
			c.Job.Properties.NonWarrantyProperties.PurchaseOrderReference = true;
			c.Job.Properties.NonWarrantyProperties.PurchaseOrderSent = true;
			c.Job.Properties.NonWarrantyProperties.RepairProviderDetails = true;
			c.Job.Properties.NonWarrantyProperties.RepairerCompletedDate = true;
			c.Job.Properties.NonWarrantyProperties.RepairerLoggedDate = true;
			c.Job.Properties.NonWarrantyProperties.RepairerName = true;
			c.Job.Properties.NonWarrantyProperties.RepairerReference = true;
			c.Job.Properties.JobQueueProperties.EditAnyComments = true;
			c.Job.Properties.JobQueueProperties.EditAnyPriority = true;
			c.Job.Properties.JobQueueProperties.EditAnySLA = true;
			c.Job.Properties.JobQueueProperties.EditOwnComments = true;
			c.Job.Properties.JobQueueProperties.EditOwnPriority = true;
			c.Job.Properties.JobQueueProperties.EditOwnSLA = true;
			c.Job.Properties.DeviceHeldLocation = true;
			c.Job.Properties.DeviceHeld = true;
			c.Job.Properties.DeviceReadyForReturn = true;
			c.Job.Properties.DeviceReturned = true;
			c.Job.Properties.ExpectedClosedDate = true;
			c.Job.Properties.Flags = true;
			c.Job.Properties.NotWaitingForUserAction = true;
			c.Job.Properties.WaitingForUserAction = true;
			c.Job.Types.CreateHMisc = true;
			c.Job.Types.CreateHNWar = true;
			c.Job.Types.CreateHWar = true;
			c.Job.Types.CreateSApp = true;
			c.Job.Types.CreateSOS = true;
			c.Job.Types.CreateSImg = true;
			c.Job.Types.CreateUMgmt = true;
			c.Job.Types.ShowHMisc = true;
			c.Job.Types.ShowHNWar = true;
			c.Job.Types.ShowHWar = true;
			c.Job.Types.ShowSApp = true;
			c.Job.Types.ShowSOS = true;
			c.Job.Types.ShowSImg = true;
			c.Job.Types.ShowUMgmt = true;
			c.Job.Search = true;
			c.Job.ShowAttachments = true;
			c.Job.ShowDailyChart = true;
			c.Job.ShowFlags = true;
			c.Job.Show = true;
			c.Job.ShowJobsQueues = true;
			c.Job.ShowLogs = true;
			c.Job.ShowNonWarrantyComponents = true;
			c.Job.ShowNonWarrantyFinance = true;
			c.Job.ShowNonWarrantyInsurance = true;
			c.Job.ShowNonWarrantyRepairs = true;
			c.Job.ShowWarranty = true;
			c.Device.Properties.AssetNumber = true;
			c.Device.Properties.Details = true;
			c.Device.Properties.DeviceBatch = true;
			c.Device.Properties.DeviceProfile = true;
			c.Device.Properties.Location = true;
			c.Device.Actions.AddAttachments = true;
			c.Device.Actions.AllowUnauthenticatedEnrol = true;
			c.Device.Actions.AssignUser = true;
			c.Device.Actions.Decommission = true;
			c.Device.Actions.Delete = true;
			c.Device.Actions.EnrolDevices = true;
			c.Device.Actions.Export = true;
			c.Device.Actions.GenerateDocuments = true;
			c.Device.Actions.Import = true;
			c.Device.Actions.Recommission = true;
			c.Device.Actions.RemoveAnyAttachments = true;
			c.Device.Actions.RemoveOwnAttachments = true;
			c.Device.Search = true;
			c.Device.ShowAssignmentHistory = true;
			c.Device.ShowAttachments = true;
			c.Device.ShowCertificates = true;
			c.Device.ShowDetails = true;
			c.Device.Show = true;
			c.Device.ShowJobs = true;
			c.User.Actions.AddAttachments = true;
			c.User.Actions.AddFlags = true;
			c.User.Actions.EditFlags = true;
			c.User.Actions.GenerateDocuments = true;
			c.User.Actions.RemoveAnyAttachments = true;
			c.User.Actions.RemoveOwnAttachments = true;
			c.User.Actions.RemoveFlags = true;
			c.User.Search = true;
			c.User.ShowAttachments = true;
			c.User.ShowAssignmentHistory = true;
			c.User.ShowAssignments = true;
			c.User.Show = true;
			c.User.ShowAuthorization = true;
			c.User.ShowDetails = true;
			c.User.ShowFlagAssignments = true;
			c.User.ShowJobs = true;
			c.DiscoAdminAccount = true;
#endregion
			return c;
		}
Example #4
0
		public static List<string> GetClaimKeys(RoleClaims Claims)
        {
            var claims = Claims;
            return _roleClaims.Where(rc => rc.Value.Item1(claims)).Select(rc => rc.Key).ToList();
        }
Example #5
0
		public static RoleClaims BuildClaims(IEnumerable<string> ClaimKeys){
			var c = new RoleClaims();
			foreach (var claimKey in ClaimKeys)
				c.Set(claimKey, true);

			return c;
		}
Example #6
0
		public static void SetClaims(this AuthorizationRole role, RoleClaims Claims)
        {
            role.ClaimsJson = Newtonsoft.Json.JsonConvert.SerializeObject(Claims);
        }