using Bootstrap.DataAccess; using Bootstrap.Security; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; namespace Bootstrap.Admin.Models { /// /// /// public class NavigatorBarModel : HeaderBarModel { /// /// /// /// public NavigatorBarModel(ControllerBase controller) : base(controller.User.Identity) { Navigations = MenuHelper.RetrieveSystemMenus(UserName, $"~{controller.HttpContext.Request.Path}"); 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))); } /// /// /// public IEnumerable Navigations { get; private set; } /// /// /// public IEnumerable> Applications { get; private set; } } }