mirror of
https://github.com/bitwarden/server.git
synced 2025-12-10 00:42:07 -06:00
Add UserPremiumAccess model to represent user premium access status from personal subscriptions and memberships
This commit is contained in:
parent
02c2aa89be
commit
2184296d10
29
src/Core/Billing/Premium/Models/UserPremiumAccess.cs
Normal file
29
src/Core/Billing/Premium/Models/UserPremiumAccess.cs
Normal file
@ -0,0 +1,29 @@
|
||||
namespace Bit.Core.Billing.Premium.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents user premium access status from personal subscriptions and organization memberships.
|
||||
/// </summary>
|
||||
public class UserPremiumAccess
|
||||
{
|
||||
/// <summary>
|
||||
/// The unique identifier for the user.
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the user has a personal premium subscription.
|
||||
/// This does NOT include premium access from organizations.
|
||||
/// </summary>
|
||||
public bool PersonalPremium { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the user has premium access through any organization membership.
|
||||
/// This is true if the user is a member of at least one enabled organization that grants premium access to users.
|
||||
/// </summary>
|
||||
public bool OrganizationPremium { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the user has premium access from any source (personal subscription or organization).
|
||||
/// </summary>
|
||||
public bool HasPremiumAccess => PersonalPremium || OrganizationPremium;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user