Browse Source

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

Kenric Nugteren 1 year ago
parent
commit
725d071e24

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

@@ -8,12 +8,6 @@ namespace InABox.Core
     {
     {
         public Type SecurityDescriptor { get; set; }
         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;
         public Editable Editable { get; set; } = Editable.Hidden;
 
 
         private SecurityAttribute() { }
         private SecurityAttribute() { }
@@ -27,8 +21,11 @@ namespace InABox.Core
 
 
         public virtual SecurityAttribute Clone()
         public virtual SecurityAttribute Clone()
         {
         {
-            var result = new SecurityAttribute(SecurityDescriptor);
-            result.SecurityDescriptor = SecurityDescriptor;
+            var result = new SecurityAttribute(SecurityDescriptor)
+            {
+                SecurityDescriptor = SecurityDescriptor,
+                Editable = Editable
+            };
             return result;
             return result;
         }
         }
     }
     }

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

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