From 6fd2eed8e19bc96b9a99f13c43bd34a665a28b11 Mon Sep 17 00:00:00 2001 From: nikita Date: Wed, 25 Oct 2017 13:16:10 +0530 Subject: [PATCH] fixed the issue by checking licenseid =0 and removed the check for superadmin. now when licenseId=0 theuser will get all modules and admin tab enabled. Need to cross check from live --- 400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs | 17 ++++++++++++----- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs index 86f130b..2d7d218 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs @@ -184,7 +184,14 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers { //based on old .net code(AIA flex), we get modules based on licenseId if licenseid>0. //we verified in database that only superadmin has no licenseid so getting all modules for supeadmin - if (userInfo.UserType == AIAHTML5.API.Models.User.SUPER_ADMIN) + int licenseId, editionId; + AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId); + + userInfo.LicenseId = licenseId; + userInfo.EditionId = editionId; + + //if (userInfo.UserType == AIAHTML5.API.Models.User.SUPER_ADMIN) + if(userInfo.LicenseId == 0) { userInfo.Modules = AIAHTML5.API.Models.Users.getAllModulesList(); @@ -204,11 +211,11 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers private static void CheckLicenseStatus(User userInfo) { //05.1 For normal user need to get the license details, get the license id for authenticated user - int licenseId, editionId; - AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId); + //int licenseId, editionId; + //AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId); - userInfo.LicenseId = licenseId; - userInfo.EditionId = editionId; + //userInfo.LicenseId = licenseId; + //userInfo.EditionId = editionId; //05.2 get license details userInfo.LicenseInfo = AIAHTML5.API.Models.Users.getLicenseDetails(userInfo.LicenseId); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 030a65c..c50840a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -220,7 +220,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } else { - if (result.UserType == UserTypeConstants.SUPER_ADMIN && result.IsActive) { //(!result.IsSubscriptionExpired) && + //if (result.UserType == UserTypeConstants.SUPER_ADMIN && result.IsActive) { //(!result.IsSubscriptionExpired) && + if (result.LicenseId == 0 && result.IsActive) { $rootScope.userData = result; $rootScope.userModules = result.Modules; $rootScope.isVisibleLogin = false; -- libgit2 0.21.4