From 3d5f6e47bd74ce77d5ec253f51b7cef1b42099ef Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Thu, 5 Oct 2023 15:53:02 +1100 Subject: Continued to refine ACLDialog --- Pages/Component/AclDialog.razor | 97 +++++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 38 deletions(-) (limited to 'Pages/Component/AclDialog.razor') diff --git a/Pages/Component/AclDialog.razor b/Pages/Component/AclDialog.razor index 87fbd6e..6df9320 100644 --- a/Pages/Component/AclDialog.razor +++ b/Pages/Component/AclDialog.razor @@ -2,50 +2,71 @@ @inject IDbContextFactory dbFactory; @implements IDialog - -
-
- @if(obj?.Acl is not null) { - - - - - - - @foreach(var rule in obj.Acl.Rules.OrderByDescending(r => r.Action)) { + +
+
+
+ @if(obj?.Acl is not null) { + +
ActionSubjectPermissions
- - - - + + + + @foreach(var rule in obj.Acl.Rules.OrderByDescending(r => r.Action)) { + + + + + + + } +
- @(WellKnownSid.TranslateSid(rule.Principal) ?? rule.Principal.ToString()) - @GetActivePermissions(rule) - 🖉 - - ActionSubjectPermissions
+ @(WellKnownSid.TranslateSid(rule.Principal) ?? rule.Principal.ToString()) + @GetActivePermissions(rule) + 🖉 + +
+
+
Add new
+ } else { +

This item does not have any permissions set!

+ } +
+
+ @if(obj?.Acl is not null) { +
+ + +
+ var permissions = Acl.GetPermissionDescriptions(obj) + .OrderByDescending(kv => BitOperations.PopCount(kv.Value)) + .ThenBy(kv => kv.Value); + foreach(var kv in permissions) { + } - -
-
Add new
- } else { -
This item does not have any permissions set!
- } -
-
-

Click Edit next to an ACL to edit it's permissions

+ } else { +

Click Edit next to an ACL to edit it's permissions

+ } +
- - @if(obj?.Acl is not null) { - - - - - } else { + @if(obj?.Acl is not null) { + + } - } +
@code { @@ -109,7 +130,7 @@ return string.Join(", ", perms .OrderByDescending(kv => BitOperations.PopCount(kv.Value)) - .ThenByDescending(kv => kv.Value) + .ThenBy(kv => kv.Value) .Select(kv => kv.Key)); } } \ No newline at end of file -- cgit v1.3