UserPermissionCacheItem.cs 748 B

12345678910111213141516171819202122232425262728293031
  1. namespace VberZero.Authorization.Users;
  2. /// <summary>
  3. /// Used to cache roles and permissions of a user.
  4. /// </summary>
  5. [Serializable]
  6. public class UserPermissionCacheItem
  7. {
  8. public const string CacheStoreName = "AbpZeroUserPermissions";
  9. public long UserId { get; set; }
  10. public List<int> RoleIds { get; set; }
  11. public HashSet<string> GrantedPermissions { get; set; }
  12. public HashSet<string> ProhibitedPermissions { get; set; }
  13. public UserPermissionCacheItem()
  14. {
  15. RoleIds = new List<int>();
  16. GrantedPermissions = new HashSet<string>();
  17. ProhibitedPermissions = new HashSet<string>();
  18. }
  19. public UserPermissionCacheItem(long userId)
  20. : this()
  21. {
  22. UserId = userId;
  23. }
  24. }