瀏覽代碼

Fix to the Security Attribute and remvoed the Visible property since it don't do nothing.

Kenric Nugteren 1 年之前
父節點
當前提交
725d071e24
共有 2 個文件被更改,包括 6 次插入14 次删除
  1. 5 8
      InABox.Core/Editors/Utils/SecurityAttribute.cs
  2. 1 6
      inabox.wpf/DynamicGrid/DynamicEditorGrid.xaml.cs

+ 5 - 8
InABox.Core/Editors/Utils/SecurityAttribute.cs

@@ -8,12 +8,6 @@ namespace InABox.Core
     {
         public Type SecurityDescriptor { get; set; }
 
-        /// <summary>
-        /// If the user does not have the security token, this property will be <see cref="Visible.Visible"/> if <see langword="true"/>
-        /// or <see cref="Visible.Hidden"/> if <see langword="false"/>. The default is <see langword="false"/>.
-        /// </summary>
-        public bool Visible { get; set; } = false;
-
         public Editable Editable { get; set; } = Editable.Hidden;
 
         private SecurityAttribute() { }
@@ -27,8 +21,11 @@ namespace InABox.Core
 
         public virtual SecurityAttribute Clone()
         {
-            var result = new SecurityAttribute(SecurityDescriptor);
-            result.SecurityDescriptor = SecurityDescriptor;
+            var result = new SecurityAttribute(SecurityDescriptor)
+            {
+                SecurityDescriptor = SecurityDescriptor,
+                Editable = Editable
+            };
             return result;
         }
     }

+ 1 - 6
inabox.wpf/DynamicGrid/DynamicEditorGrid.xaml.cs

@@ -597,10 +597,6 @@ namespace InABox.DynamicGrid
                     {
                         if (!Security.IsAllowed(security.SecurityDescriptor))
                         {
-                            if (!security.Visible)
-                            {
-                                editor.Visible = Visible.Hidden;
-                            }
                             if(security.Editable == Editable.Hidden)
                             {
                                 editor.Editable = Editable.Hidden;
@@ -609,9 +605,8 @@ namespace InABox.DynamicGrid
                             {
                                 editor.Editable = Editable.Disabled;
                             }
-                            if (editor.Visible == Visible.Hidden && editor.Editable == Editable.Hidden)
+                            if (editor.Editable == Editable.Hidden)
                             {
-                                editor.Editable = Editable.Hidden;
                                 break;
                             }
                         }