aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2018-12-16 08:22:45 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2018-12-16 08:22:45 +0200
commitecf55f4193c0a7ab273c7e8243e446a2f2c32d51 (patch)
treeaa965e23ba3d0dcd4fecf739b4ed95040553b628 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
parentb279560f0b4dfdd16dea6b70975dfc1961b8d61e (diff)
downloadTango-ecf55f4193c0a7ab273c7e8243e446a2f2c32d51.tar.gz
Tango-ecf55f4193c0a7ab273c7e8243e446a2f2c32d51.zip
Working on PPC tech mode & logging module.
Working on PPC date picker & calendar. Implemented no-permissions view.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs18
1 files changed, 15 insertions, 3 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
index 9d17a4a76..aa9689ef3 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
@@ -11,6 +11,8 @@ using System.ComponentModel.DataAnnotations;
using Tango.SharedUI.Helpers;
using Tango.PPC.Common.Authentication;
using Tango.BL.Entities;
+using Tango.BL.Enumerations;
+using Tango.Logging;
namespace Tango.PPC.UI.ViewModels
{
@@ -89,9 +91,19 @@ namespace Tango.PPC.UI.ViewModels
base.OnApplicationReady();
await Task.Delay(500);
- LogManager.Log("Application is ready! Navigating to home module...");
- await NavigationManager.NavigateTo(NavigationView.HomeModule);
- IsLoading = false;
+
+ if (AuthenticationProvider.CurrentUser != null && AuthenticationProvider.CurrentUser.HasPermission(Permissions.RunPPC))
+ {
+ LogManager.Log("Application is ready! Navigating to home module...");
+ await NavigationManager.NavigateTo(NavigationView.HomeModule);
+ IsLoading = false;
+ }
+ else
+ {
+ LogManager.Log("Application is ready! The logged in user does not have permission to run the application!", LogCategory.Warning);
+ await NavigationManager.NavigateTo(NavigationView.NoPermissionsView);
+ IsLoading = false;
+ }
}
#endregion