Prechádzať zdrojové kódy

Added Security Descriptors to fix missing MyHR module

Frank van den Bos 1 rok pred
rodič
commit
0b06eba1ad

+ 22 - 1
prs.classes/SecurityDescriptors/Mobile_Access.cs

@@ -71,8 +71,29 @@ namespace Comal.Classes.SecurityDescriptors
     { 
     }
     
-    [Caption("View Document Scanner Module")]
+    [Caption("View Mobile Document Scanner Module")]
     public class ViewMobileDocumentScannerModule : EnabledSecurityDescriptor<MobileAccessLicence>
     { 
     }
+    
+    [Caption("View Mobile Employee Details Module")]
+    public class ViewMobileEmployeeDetailsModule : EnabledSecurityDescriptor<MobileAccessLicence>
+    { 
+    }
+    [Caption("View Mobile Employee Forms Module")]
+    public class ViewMobileEmployeeFormsModule : EnabledSecurityDescriptor<MobileAccessLicence>
+    { 
+    }
+    [Caption("View Mobile Leave Requests Module")]
+    public class ViewMobileLeaveRequestsModule : EnabledSecurityDescriptor<MobileAccessLicence>
+    { 
+    }
+    [Caption("View Mobile Qualifications Module")]
+    public class ViewMobileQualificationsModule : EnabledSecurityDescriptor<MobileAccessLicence>
+    { 
+    }
+    [Caption("View MobileTimesheets Module")]
+    public class ViewMobileTimesheetsModule : EnabledSecurityDescriptor<MobileAccessLicence>
+    { 
+    }
 }

+ 1 - 1
prs.mobile.new/PRS.Mobile/MainPage.xaml

@@ -185,7 +185,7 @@
                         Image="person"
                         Clicked="HumanResourcesModuleTapped"
                         IsEnabled="False"
-                        IsVisible="False"/>  
+                        IsVisible="True"/>  
                                 
                     <mobile:MobileToolItem
                         x:Name="Notifications"

+ 7 - 0
prs.mobile.new/PRS.Mobile/MainPage.xaml.cs

@@ -241,6 +241,13 @@ namespace PRS.Mobile
             Deliveries.IsVisible = Security.IsAllowed<ViewMobileDeliveriesModule>();
             Forms.IsVisible = Security.IsAllowed<ViewMobileFormsModule>();
             Equipment.IsVisible = Security.IsAllowed<ViewMobileEquipmentModule>();
+            MyHR.IsVisible =
+                Security.IsAllowed<ViewMobileEmployeeDetailsModule>()
+                || Security.IsAllowed<ViewMobileEmployeeFormsModule>()
+                || Security.IsAllowed<ViewMobileLeaveRequestsModule>()
+                || Security.IsAllowed<ViewMobileQualificationsModule>()
+                || Security.IsAllowed<ViewMobileTimesheetsModule>();
+               
             InOut.IsVisible = Security.IsAllowed<ViewMobileInOutModule>();
             Manufacturing.IsVisible = Security.IsAllowed<ViewMobileManufacturingModule>();
             Meetings.IsVisible = Security.IsAllowed<ViewMobileMeetingsModule>();

+ 5 - 0
prs.mobile.new/PRS.Mobile/Modules/Human Resources/HumanResourcesModule.xaml

@@ -17,6 +17,7 @@
                     Description="View or Update Personal Details"
                     Thumbnail="person"
                     Tapped="MyDetails_OnTapped"
+                    IsVisible="False"
                 />    
                 
                 <mobile:MobileModuleItem
@@ -25,6 +26,7 @@
                     Description="View or Update Qualifications and Tickets"
                     Thumbnail="badge"
                     Tapped="QualificationsBtn_Tapped"
+                    IsVisible = "False"
                 />  
 
                 <mobile:MobileModuleItem
@@ -33,6 +35,7 @@
                     Description="Complete and Lodge Digital Forms"
                     Thumbnail="digitalform"
                     Tapped="EmployeeFormsBtn_Tapped"
+                    IsVisible = "False"
                 />   
                 
                 <mobile:MobileModuleItem
@@ -41,6 +44,7 @@
                     Description="Manage Leave Requests"
                     Thumbnail="holiday"
                     Tapped="LeaveBtn_Tapped"
+                    IsVisible = "False"
                 />    
                 
                 <mobile:MobileModuleItem
@@ -49,6 +53,7 @@
                     Description="View Current Timesheets"
                     Thumbnail="clock"
                     Tapped="TimesheetsBtn_Tapped"
+                    IsVisible = "False"
                 />   
                 
             </mobile:MobileModuleList.Items>

+ 7 - 0
prs.mobile.new/PRS.Mobile/Modules/Human Resources/HumanResourcesModule.xaml.cs

@@ -1,6 +1,8 @@
 using System;
 using System.Threading;
 using System.Threading.Tasks;
+using Comal.Classes.SecurityDescriptors;
+using InABox.Core;
 using InABox.Mobile;
 using Xamarin.Forms.Xaml;
 
@@ -15,6 +17,11 @@ namespace PRS.Mobile
         public HumanResourcesModule()
         {
             InitializeComponent();
+            MyDetails.IsVisible = Security.IsAllowed<ViewMobileEmployeeDetailsModule>();
+            DigitalForms.IsVisible = Security.IsAllowed<ViewMobileEmployeeFormsModule>();
+            LeaveRequests.IsVisible = Security.IsAllowed<ViewMobileLeaveRequestsModule>();
+            Qualifications.IsVisible = Security.IsAllowed<ViewMobileQualificationsModule>();
+            TimeSheets.IsVisible = Security.IsAllowed<ViewMobileTimesheetsModule>();
         }
 
         protected override void OnAppearing()