Role.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace GreenTree.Nachtragsmanagement.Core.Domain.User
  7. {
  8. public class Role : BaseEntity
  9. {
  10. #region Fields
  11. /// <summary>
  12. /// Functionlist
  13. /// </summary>
  14. private ICollection<Function> _functions;
  15. #endregion
  16. /// <summary>
  17. /// Description
  18. /// </summary>
  19. public string Description { get; set; }
  20. /// <summary>
  21. /// Level of right (higher value means higher right)
  22. /// </summary>
  23. public int Level { get; set; }
  24. /// <summary>
  25. /// Determines if the role can only see sites which it is assigned to
  26. /// </summary>
  27. public bool SeeOnlyAssigned { get; set; }
  28. /// <summary>
  29. /// Functions the role have
  30. /// </summary>
  31. public virtual ICollection<Function> Functions
  32. {
  33. get { return _functions ?? (_functions = new List<Function>()); }
  34. protected set { _functions = value; }
  35. }
  36. #region Helper
  37. /// <summary>
  38. /// Adds missing functions and removes not selected functions
  39. /// </summary>
  40. /// <param name="functions">Functions.</param>
  41. public void SetFunctions(ICollection<Function> functions)
  42. {
  43. Functions = functions;
  44. }
  45. #endregion
  46. }
  47. }