Skip to content

Commit e1d2a57

Browse files
committed
Fix: Fix UI in Security pages
1 parent 531b326 commit e1d2a57

File tree

7 files changed

+415
-261
lines changed

7 files changed

+415
-261
lines changed

src/Files.App/Filesystem/Security/AccessControlEntry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public AccessControlType AccessControlType
3333
public string AccessControlTypeGlyph
3434
=> AccessControlType switch
3535
{
36-
AccessControlType.Allow => "\xF13E",
36+
AccessControlType.Allow => "\xE73E",
3737
_ => "\xF140" // AccessControlType.Deny
3838
};
3939

src/Files.App/Filesystem/Security/Principal.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using CommunityToolkit.Mvvm.ComponentModel;
2-
using Files.App.Extensions;
32
using System.Collections.Generic;
43
using System.Text;
54
using static Vanara.PInvoke.AdvApi32;
@@ -25,11 +24,14 @@ public string Glyph
2524

2625
public string? Name { get; set; }
2726

28-
public string DisplayName
29-
=> string.IsNullOrEmpty(Name) ? "SecurityUnknownAccount".GetLocalizedResource() : Name;
27+
public string? DisplayName
28+
=> string.IsNullOrEmpty(Name) ? Sid : Name;
3029

31-
public string FullNameOrSid
32-
=> string.IsNullOrEmpty(Name) ? Sid : string.IsNullOrEmpty(Domain) ? Name : $"{Domain}\\{Name}";
30+
public string? FullNameOrSid
31+
=> string.IsNullOrEmpty(Domain) ? Sid : $"{Domain}\\{Name}";
32+
33+
public string? FullNameHumanized
34+
=> string.IsNullOrEmpty(Domain) ? string.Empty : $"({Domain}\\{Name})";
3335

3436
public List<string> Groups { get; set; }
3537

src/Files.App/Strings/en-US/Resources.resw

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,7 @@
16421642
<value>You do not have permissions to view the security properties of this object. Click "Advanced permissions" to proceed.</value>
16431643
</data>
16441644
<data name="SecurityOwnerLabel.Text" xml:space="preserve">
1645-
<value>Owner</value>
1645+
<value>Owner:</value>
16461646
</data>
16471647
<data name="SecurityUnknownOwnerText.Text" xml:space="preserve">
16481648
<value>Unknown owner</value>
@@ -1683,8 +1683,8 @@
16831683
<data name="SecurityAdvancedAppliesToLabel.Text" xml:space="preserve">
16841684
<value>Applies to</value>
16851685
</data>
1686-
<data name="SecurityAdvancedEntityLabel.Text" xml:space="preserve">
1687-
<value>Entity</value>
1686+
<data name="SecurityAdvancedPrincipal" xml:space="preserve">
1687+
<value>Principal</value>
16881688
</data>
16891689
<data name="SecurityAdvancedFlagsFilesLabel" xml:space="preserve">
16901690
<value>files</value>

src/Files.App/ViewModels/Properties/SecurityViewModel.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
using Files.App.Filesystem;
66
using Files.App.Filesystem.Security;
77
using Files.App.Helpers;
8-
using System.Collections.Generic;
9-
using System.Linq;
8+
using Microsoft.UI.Xaml;
109
using System.Threading.Tasks;
1110
using Windows.Storage;
1211

@@ -91,6 +90,18 @@ public string DisableInheritanceOption
9190

9291
private bool _preserveInheritance;
9392

93+
private GridLength _columnType = new(64d);
94+
public GridLength ColumnType { get => _columnType; set => SetProperty(ref _columnType, value); }
95+
96+
private GridLength _columnPrincipal = new(200d);
97+
public GridLength ColumnPrincipal { get => _columnPrincipal; set => SetProperty(ref _columnPrincipal, value); }
98+
99+
private GridLength _columnAccess = new(160d);
100+
public GridLength ColumnAccess { get => _columnAccess; set => SetProperty(ref _columnAccess, value); }
101+
102+
private GridLength _columnInherited = new(70d);
103+
public GridLength ColumnInherited { get => _columnInherited; set => SetProperty(ref _columnInherited, value); }
104+
94105
public RelayCommand ChangeOwnerCommand { get; set; }
95106
public RelayCommand AddAccessControlEntryCommand { get; set; }
96107
public RelayCommand RemoveAccessControlEntryCommand { get; set; }

0 commit comments

Comments
 (0)