qol: formatting
This commit is contained in:
@@ -43,7 +43,7 @@ namespace Disco.Services.Authorization
|
||||
Name = "Access Denied",
|
||||
Format = "User: {0}; Resource: {1}; Reason: {2}",
|
||||
Severity = (int)LogEventType.Severities.Warning,
|
||||
UseLive = true, UsePersist = true, UseDisplay = true
|
||||
UseLive = true, UsePersist = true, UseDisplay = true
|
||||
},
|
||||
new LogEventType() {
|
||||
Id = (int)EventTypeIds.RoleCreated,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Services.Authorization.Roles;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Disco.Services.Authorization
|
||||
public class ClaimNavigatorItem : IClaimNavigatorItem
|
||||
{
|
||||
private Func<RoleClaims, bool> accessor { get; set; }
|
||||
|
||||
|
||||
public string Key { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
@@ -49,15 +49,15 @@ namespace Disco.Services.Authorization
|
||||
public IClaimNavigatorItem BuildClaimTree(RoleClaims RoleClaims)
|
||||
{
|
||||
return new ClaimNavigatorItem()
|
||||
{
|
||||
Key = Key,
|
||||
Name = Name,
|
||||
Description = Description,
|
||||
Hidden = Hidden,
|
||||
accessor = accessor,
|
||||
Value = accessor == null ? (bool?)null : accessor(RoleClaims),
|
||||
Children = Children == null ? null : Children.Cast<ClaimNavigatorItem>().Select(c => c.BuildClaimTree(RoleClaims)).ToList()
|
||||
};
|
||||
{
|
||||
Key = Key,
|
||||
Name = Name,
|
||||
Description = Description,
|
||||
Hidden = Hidden,
|
||||
accessor = accessor,
|
||||
Value = accessor == null ? (bool?)null : accessor(RoleClaims),
|
||||
Children = Children == null ? null : Children.Cast<ClaimNavigatorItem>().Select(c => c.BuildClaimTree(RoleClaims)).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
public IClaimNavigatorItem BuildClaimTree(IEnumerable<RoleClaims> RoleClaims)
|
||||
|
||||
@@ -30,11 +30,10 @@ namespace Disco.Services.Authorization
|
||||
|
||||
if (UserService.CurrentAuthorization == null)
|
||||
resultMessage = AuthorizationToken.RequireAuthenticationMessage;
|
||||
else if (string.IsNullOrEmpty(authorizedClaim))
|
||||
resultMessage = AuthorizationToken.RequireDiscoAuthorizationMessage;
|
||||
else
|
||||
if (string.IsNullOrEmpty(authorizedClaim))
|
||||
resultMessage = AuthorizationToken.RequireDiscoAuthorizationMessage;
|
||||
else
|
||||
resultMessage = AuthorizationToken.BuildRequireMessage(authorizedClaim);
|
||||
resultMessage = AuthorizationToken.BuildRequireMessage(authorizedClaim);
|
||||
|
||||
return resultMessage;
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
[ClaimDetails("Bulk Generate Document Templates", "Can bulk generate document templates")]
|
||||
public bool BulkGenerate { get; set; }
|
||||
|
||||
|
||||
[ClaimDetails("Export Attachment Instances", "Can export document attachment instances")]
|
||||
public bool Export { get; set; }
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
[ClaimDetails("Configure Proxy Settings", "Can configure the proxy settings")]
|
||||
public bool ConfigureProxy { get; set; }
|
||||
|
||||
|
||||
[ClaimDetails("Configure Email Settings", "Can configure the email settings")]
|
||||
public bool ConfigureEmail { get; set; }
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
public bool DevicesReadyForReturn { get; set; }
|
||||
[ClaimDetails("Devices Awaiting Repair List", "Can show list")]
|
||||
public bool DevicesAwaitingRepair { get; set; }
|
||||
|
||||
|
||||
[ClaimDetails("Awaiting Finance List", "Can show list")]
|
||||
public bool AwaitingFinance { get; set; }
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
public bool AwaitingFinanceInsuranceProcessing { get; set; }
|
||||
[ClaimDetails("Awaiting Finance Agreement Breach List", "Can show list (NOTE: Requires Awaiting Finance List)")]
|
||||
public bool AwaitingFinanceAgreementBreach { get; set; }
|
||||
|
||||
|
||||
[ClaimDetails("Awaiting User Action List", "Can show list")]
|
||||
public bool AwaitingUserAction { get; set; }
|
||||
[ClaimDetails("Recently Closed List", "Can show list")]
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
public bool ShowSImg { get; set; }
|
||||
[ClaimDetails("Show Software - Operating System Jobs", "Can show jobs of this type")]
|
||||
public bool ShowSOS { get; set; }
|
||||
|
||||
|
||||
[ClaimDetails("Show User Management Jobs", "Can show jobs of this type")]
|
||||
public bool ShowUMgmt { get; set; }
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles
|
||||
{
|
||||
@@ -156,7 +156,7 @@ namespace Disco.Services.Authorization.Roles
|
||||
{
|
||||
// Determine roles which need migration from DBv11 -> DBv14
|
||||
var affectedRoles_DBv14 = Database.AuthorizationRoles.Where(r => !r.ClaimsJson.Contains("MyJobs")).ToList();
|
||||
|
||||
|
||||
// Determine roles which need migration from DBv14 -> DBv15
|
||||
var affectedRoles_DBv15 = Database.AuthorizationRoles.Where(r => !r.ClaimsJson.Contains("RepairProviderDetails")).ToList();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -20,7 +20,7 @@ namespace Disco.Services.Authorization.Roles
|
||||
|
||||
return FromAuthorizationRole(Role, claims);
|
||||
}
|
||||
|
||||
|
||||
internal static RoleToken FromAuthorizationRole(AuthorizationRole Role, RoleClaims Claims)
|
||||
{
|
||||
string[] sg = (Role.SubjectIds == null ? new string[0] : Role.SubjectIds.Split(',').ToArray());
|
||||
|
||||
Reference in New Issue
Block a user