summaryrefslogtreecommitdiff
path: root/Pages/Component/AclDialog.razor
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2023-10-04 15:59:52 +1100
committerJake Mannens <jake@asger.xyz>2023-10-04 15:59:52 +1100
commitaa0b68f7648bd5a7c14b64737a4f8d3e402bfce5 (patch)
treef058842f77cfbd6e2a21abd3e4f8ad4f8ad1ed9a /Pages/Component/AclDialog.razor
parent33438ac951430fa370965b42a3d98a54e704ab01 (diff)
Fix SID equality and WellKnownSid mappings
Diffstat (limited to 'Pages/Component/AclDialog.razor')
-rw-r--r--Pages/Component/AclDialog.razor57
1 files changed, 34 insertions, 23 deletions
diff --git a/Pages/Component/AclDialog.razor b/Pages/Component/AclDialog.razor
index 8116f04..87fbd6e 100644
--- a/Pages/Component/AclDialog.razor
+++ b/Pages/Component/AclDialog.razor
@@ -2,35 +2,46 @@
@inject IDbContextFactory<HBContext> dbFactory;
@implements IDialog
-<Dialog Title="Edit permissions" @ref=dialog>
- @if(obj?.Acl is not null) {
- <table class="data-table">
- <tr>
- <th>Action</th>
- <th>Subject</th>
- <th>Permissions</th>
- <th></th>
- </tr>
- @foreach(var rule in obj.Acl.Rules.OrderByDescending(r => r.Action)) {
- <tr>
- <td><div><AclActionSwitch InitialValue=@(rule.Action == AclRuleAction.Allow)/></div></td>
- <td>@rule.Principal.ToString()</td>
- <td>@GetActivePermissions(rule)</td>
- <td>
- <a title="Edit" href="javascript:;">&#x1F589</a>
- <a title="Delete" href="javascript:;">&#x2716</a>
- </td>
- </tr>
+<Dialog WidthPixels=900 Title="Edit permissions" @ref=dialog>
+ <div class="container">
+ <div>
+ @if(obj?.Acl is not null) {
+ <table class="data-table">
+ <tr>
+ <th>Action</th>
+ <th>Subject</th>
+ <th colspan="2">Permissions</th>
+ </tr>
+ @foreach(var rule in obj.Acl.Rules.OrderByDescending(r => r.Action)) {
+ <tr>
+ <td><div><AclActionSwitch InitialValue=@(rule.Action == AclRuleAction.Allow)/></div></td>
+ <td>
+ <a class="nondecorated" href="javascript:;">@(WellKnownSid.TranslateSid(rule.Principal) ?? rule.Principal.ToString())</a>
+ </td>
+ <td>@GetActivePermissions(rule)</td>
+ <td>
+ <a title="Edit" href="javascript:;">&#x1F589</a>
+ <a title="Delete" href="javascript:;">&#x2716</a>
+ </td>
+ </tr>
+ }
+ </table>
+ <br/>
+ <center><a href="javascript:;">Add new</a></center>
+ } else {
+ <center><i>This item does not have any permissions set!</i></center>
}
- </table>
- <br/>
- <center><a href="javascript:;">Add new</a></center>
+ </div>
+ <div>
+ <p><i>Click Edit next to an ACL to edit it's permissions</i></p>
+ </div>
+ </div>
+ @if(obj?.Acl is not null) {
<ButtonContainer>
<button class="secondary" @onclick=Hide>Cancel</button>
<button data-keyboard-shortcut="a" @onclick=Hide><u>A</u>pply</button>
</ButtonContainer>
} else {
- <center><i>This item does not have any permissions set!</i></center>
<ButtonContainer>
<button class="secondary" @onclick=Hide>Cancel</button>
</ButtonContainer>