2021-04-03 11:41:02 +04:00
|
|
|
|
using DepartmentWindowsDesktop.EntityControls;
|
|
|
|
|
using DesktopTools.Interfaces;
|
|
|
|
|
using DesktopTools.Models;
|
|
|
|
|
using ModuleTools.BindingModels;
|
|
|
|
|
using ModuleTools.BusinessLogics;
|
|
|
|
|
using ModuleTools.Enums;
|
|
|
|
|
using ModuleTools.Interfaces;
|
|
|
|
|
using ModuleTools.Models;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace DepartmentWindowsDesktop
|
|
|
|
|
{
|
|
|
|
|
public class DepartmentWindowDesktopExtension : IWindowDesktopExtension
|
|
|
|
|
{
|
|
|
|
|
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 ControlEmployeePostList(),
|
2021-04-03 13:41:19 +04:00
|
|
|
|
new ControlEmployeeList(),
|
|
|
|
|
new ControlClassroomList()
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|