using DesktopTools.Interfaces; using DesktopTools.Models; using ModuleTools.BindingModels; using ModuleTools.BusinessLogics; using ModuleTools.Enums; using ModuleTools.Interfaces; using ModuleTools.Models; using SecurityWindowsDesktop.Controls; using System.Collections.Generic; namespace SecurityWindowsDesktop { public class SecurityWindowDesktopExtension : IWindowDesktopExtension { public List GetListControlEntityList() { var manager = DependencyManager.Instance.Resolve(); if (manager == null) { return null; } if (!manager.CheckAccess(new SecurityManagerCheckAccessModel(new AccessBindingModel { UserIdForAccess = manager.User }, AccessOperation.Администрирование, AccessType.View, "Администрирование"))) { return null; } var list = new List { new WindowDesktopExtensionControlModel { Title = "Администрирование" } }; List _controls = new() { new ControlUserList(), new ControlRoleList(), new ControlAccessList(), new ControlEnviromentSettingList() }; foreach (var cntrl in _controls) { if (manager.CheckAccess(new SecurityManagerCheckAccessModel(new AccessBindingModel { UserIdForAccess = manager.User }, cntrl.AccessOperation, AccessType.View, cntrl.Title))) { list.Add(new WindowDesktopExtensionControlModel { Id = cntrl.ControlId, Title = cntrl.Title, Control = cntrl }); } } return list; } } }