修改BUG:用户个人中心自定义应用可以看到未授权应用 #IS5F1

This commit is contained in:
Argo-MacBookPro 2019-03-01 15:43:52 +08:00
parent 5ea8022d3c
commit 1f1230e488
1 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,9 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security; using Bootstrap.Security;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Models
{ {
@ -17,7 +19,8 @@ namespace Bootstrap.Admin.Models
public NavigatorBarModel(ControllerBase controller) : base(controller.User.Identity) public NavigatorBarModel(ControllerBase controller) : base(controller.User.Identity)
{ {
Navigations = MenuHelper.RetrieveSystemMenus(UserName, $"~{controller.HttpContext.Request.Path}"); Navigations = MenuHelper.RetrieveSystemMenus(UserName, $"~{controller.HttpContext.Request.Path}");
Applications = DictHelper.RetrieveApps(); var authApps = AppHelper.RetrievesByUserName(controller.User.Identity.Name);
Applications = DictHelper.RetrieveApps().Where(app => app.Key == "0" || authApps.Any(key => key.Equals(app.Key, StringComparison.OrdinalIgnoreCase)));
} }
/// <summary> /// <summary>
/// ///