DepartmentProject/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs

73 lines
2.0 KiB
C#
Raw Normal View History

2021-04-03 11:41:02 +04:00
using DepartmentWindowsDesktop.EntityControls;
using System.Collections.Generic;
2022-03-18 22:48:14 +04:00
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
2022-03-20 10:10:44 +04:00
using ToolsModule.ManagmentDependency;
using ToolsModule.ManagmentSecurity;
2021-04-03 11:41:02 +04:00
namespace DepartmentWindowsDesktop
{
public class DepartmentWindowDesktopExtension : IWindowDesktopExtension
2021-04-03 11:41:02 +04:00
{
public List<WindowDesktopExtensionControlModel> GetListControlEntityList()
{
var manager = DependencyManager.Instance.Resolve<ISecurityManager>();
if (manager == null)
{
return null;
}
if (!manager.CheckAccess(new SecurityManagerCheckAccessModel(new AccessBindingModel { UserIdForAccess = manager.User },
AccessOperation.Кафедра, AccessType.View, "Кафедра")))
{
return null;
}
var list = new List<WindowDesktopExtensionControlModel>
{
new WindowDesktopExtensionControlModel { Title = "Кафедра" }
};
List<IControl> _controls = new()
{
new ControlPostList(),
2021-04-03 13:41:19 +04:00
new ControlEmployeeList(),
2021-04-03 19:03:56 +04:00
new ControlClassroomList(),
new ControlDisciplineBlockList(),
new ControlDisciplineList(),
new ControlLecturerAcademicDegreeList(),
new ControlLecturerAcademicRankList(),
new ControlLecturerList(),
2021-04-06 22:07:11 +04:00
new ControlEducationDirectionList(),
new ControlTimeNormList(),
2021-04-12 10:01:42 +04:00
new ControlAcademicPlanList(),
2021-04-12 16:57:29 +04:00
new ControlStudentGroupList(),
2021-04-13 12:52:45 +04:00
new ControlStudentList(),
new ControlOrderList(),
new ControlBasicDepartmentList(),
2022-03-27 14:51:27 +04:00
new ControlOrderSyncHistoryList(),
new ControlStudentMarkSyncHistoryList(),
2021-04-03 11:41:02 +04:00
};
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;
}
public List<WindowDesktopExtensionControlModel> GetListControlSpecialList()
{
return null;
}
}
}