From ecf55f4193c0a7ab273c7e8243e446a2f2c32d51 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 16 Dec 2018 08:22:45 +0200 Subject: Working on PPC tech mode & logging module. Working on PPC date picker & calendar. Implemented no-permissions view. --- .../PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs') 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 -- cgit v1.3.1