IPermissionControl.cs 849 B

12345678910111213141516171819202122232425262728293031
  1. using Model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Permission
  8. {
  9. public interface IPermissionControl
  10. {
  11. PermissionLevel RequiredPermissionLevel { get; set; }
  12. PermissionLevel CurrentPermissionLevel { get; set; }
  13. bool IsPermissionGot { get;}
  14. }
  15. // 表示一个被授权的控件(最小粒度)
  16. public class AuthorizedControl
  17. {
  18. public string Namespace { get; set; } = "";
  19. public string FormType { get; set; } = ""; // FullName
  20. public string ControlName { get; set; } = "";
  21. }
  22. // 整个权限配置 = 一组授权控件
  23. public class PermissionProfile
  24. {
  25. public List<AuthorizedControl> AuthorizedControls { get; set; } = new List<AuthorizedControl>();
  26. }
  27. }