IwbUserPermissionCacheItem.cs 889 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. namespace IwbZero.Caching
  4. {
  5. /// <summary>
  6. /// Used to cache roles and permissions of a user.
  7. /// </summary>
  8. [Serializable]
  9. public class IwbUserPermissionCacheItem
  10. {
  11. public const string CacheStoreName = "IwbAdminUserPermissions";
  12. public long UserId { get; set; }
  13. public List<int> RoleIds { get; set; }
  14. public HashSet<string> GrantedPermissions { get; set; }
  15. public HashSet<string> ProhibitedPermissions { get; set; }
  16. public IwbUserPermissionCacheItem()
  17. {
  18. RoleIds = new List<int>();
  19. GrantedPermissions = new HashSet<string>();
  20. ProhibitedPermissions = new HashSet<string>();
  21. }
  22. public IwbUserPermissionCacheItem(long userId)
  23. : this()
  24. {
  25. UserId = userId;
  26. }
  27. }
  28. }