Forráskód Böngészése

PRS MOBILE - Implement security token for Assignment Module sidebar visbility

Nick-PRSDigital@bitbucket.org 2 éve
szülő
commit
5e1c6fde00

+ 12 - 1
prs.mobile/comal.timesheets/Assignments/AssignmentList.xaml.cs

@@ -14,6 +14,7 @@ using WebSocketSharp;
 using XF.Material.Forms;
 using XF.Material.Forms.UI.Dialogs;
 using XF.Material.Forms.UI.Dialogs.Configurations;
+using PRSSecurity = InABox.Core.Security;
 
 namespace comal.timesheets
 {
@@ -70,6 +71,8 @@ namespace comal.timesheets
 
             _teamname = _settings.TeamName;
 
+            if (!PRSSecurity.IsAllowed<CanViewMobileAssignmentsSidebar>())
+                CollapseSideBar(true);
         }
 
         protected override void OnAppearing()
@@ -79,16 +82,24 @@ namespace comal.timesheets
             Reload();
         }
 
-        private void CollapseButton_Tapped(object sender, EventArgs e)
+        private void CollapseSideBar(bool permanent = false)
         {
             CollapseButton.IsVisible = false;
             ExpandButton.IsVisible = true;
 
             JobColumn.Width = 0;
 
+            if (permanent)
+                ExpandButton.IsVisible = false;
+
             Refresh();
         }
 
+        private void CollapseButton_Tapped(object sender, EventArgs e)
+        {
+            CollapseSideBar();
+        }
+
         private void ExpandButton_Tapped(object sender, EventArgs e)
         {
             CollapseButton.IsVisible = true;