فهرست منبع

Added security tokens for panel configuration

Kenric Nugteren 1 سال پیش
والد
کامیت
a6428d271c

+ 5 - 0
prs.classes/SecurityDescriptors/Accounts_Descriptors.cs

@@ -5,6 +5,11 @@ using System.Text;
 
 namespace Comal.Classes
 {
+    [Caption("Configure Accounts Panels")]
+    public class CanConfigureAccountsPanels : EnabledSecurityDescriptor<AccountsPayableLicense>
+    {
+    }
+
     [Caption("Open and Close Purchase Orders")]
     public class CanOpenAndClosePurchaseOrders : EnabledSecurityDescriptor<AccountsPayableLicense, Assignment>
     {

+ 5 - 0
prs.classes/SecurityDescriptors/Manufacturing_Descriptors.cs

@@ -3,6 +3,11 @@ using InABox.Core;
 
 namespace Comal.Classes
 {
+    [Caption("Configure Manufacturing Panels")]
+    public class CanConfigureManufacturingPanels : EnabledSecurityDescriptor<ManufacturingLicense, ManufacturingPacket>
+    {
+    }
+
     [Caption("View Factory Status Module")]
     public class CanViewFactoryStatus : EnabledSecurityDescriptor<ManufacturingLicense, ManufacturingPacket>
     {

+ 5 - 0
prs.classes/SecurityDescriptors/Product_Descriptors.cs

@@ -2,6 +2,11 @@
 
 namespace Comal.Classes
 {
+    [Caption("Configure Products Panels")]
+    public class CanConfigureProductsPanels : EnabledSecurityDescriptor<ProductManagementLicense, Product>
+    {
+    }
+
     [Caption("Change Product GL Codes")]
     public class CanChangeProductGLCodes : EnabledSecurityDescriptor<ProductManagementLicense, Product>
     {

+ 5 - 0
prs.classes/SecurityDescriptors/Task_Descriptors.cs

@@ -3,6 +3,11 @@ using InABox.Core;
 
 namespace Comal.Classes
 {
+    [Caption("Configure Task Panel")]
+    public class CanConfigureTasksPanel : EnabledSecurityDescriptor<TaskManagementLicense, Kanban>
+    {
+    }
+
     public class CanViewTasks : AutoSecurityDescriptor<Kanban, CanView<Kanban>>
     {
         public override string Code => GetType().EntityName().Split('.').Last();

+ 2 - 3
prs.desktop/MainWindow.xaml.cs

@@ -3082,9 +3082,8 @@ namespace PRSDesktop
             }
             else
             {
-                var editor = new DynamicEditorForm(typeof(TProperties));
-                editor.Items = new BaseObject[] { properties };
-                result = editor.ShowDialog() == true;
+                var grid = new DynamicItemsListGrid<TProperties>();
+                result = grid.EditItems(new TProperties[] { properties });
             }
 
             if (result)

+ 1 - 2
prs.desktop/Panels/Manufacturing/ManufacturingPanel.xaml.cs

@@ -18,8 +18,7 @@ using System.ComponentModel;
 
 namespace PRSDesktop
 {
-    public partial class ManufacturingPanel : UserControl, IPanel<ManufacturingPacket>, IPropertiesPanel<ManufacturingPanelProperties
-        >
+    public partial class ManufacturingPanel : UserControl, IPanel<ManufacturingPacket>, IPropertiesPanel<ManufacturingPanelProperties, CanConfigureManufacturingPanels>
     {
         private readonly List<IManufacturingPanelColumn> _columns = new();
 

+ 1 - 1
prs.desktop/Panels/Suppliers/Bills/SupplierBillPanel.xaml.cs

@@ -32,7 +32,7 @@ public class SupplierBillPanelProperties : BaseObject, IGlobalConfigurationSetti
     public int CurrencyDecimalPlaces { get; set; } = 2;
 }
 
-public partial class SupplierBillPanel : UserControl, IPanel<Bill>, IPropertiesPanel<SupplierBillPanelProperties>
+public partial class SupplierBillPanel : UserControl, IPanel<Bill>, IPropertiesPanel<SupplierBillPanelProperties, CanConfigureAccountsPanels>
 {
     private SupplierBillPanelSettings settings;
 

+ 1 - 1
prs.desktop/Panels/Tasks/TaskPanel.xaml.cs

@@ -27,7 +27,7 @@ namespace PRSDesktop
     /// <summary>
     ///     Interaction logic for TaskPanel.xaml
     /// </summary>
-    public partial class TaskPanel : UserControl, IPanel<Kanban>, ITaskHost, IJobControl, IPropertiesPanel<TaskPanelProperties>
+    public partial class TaskPanel : UserControl, IPanel<Kanban>, ITaskHost, IJobControl, IPropertiesPanel<TaskPanelProperties, CanConfigureTasksPanel>
     {
         private bool _bTabChanging;
         private KanbanType[] kanbanTypes = null!; // Initialized in Setup()