mirror of
https://github.com/bitwarden/server
synced 2026-01-06 10:34:01 +00:00
license verification services for user/org
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Bit.Core.Models.Table;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
public class NoopLicenseVerificationService : ILicenseVerificationService
|
||||
{
|
||||
public NoopLicenseVerificationService(
|
||||
IHostingEnvironment environment,
|
||||
GlobalSettings globalSettings)
|
||||
{
|
||||
if(!environment.IsDevelopment() && globalSettings.SelfHosted)
|
||||
{
|
||||
throw new Exception($"{nameof(NoopLicenseVerificationService)} cannot be used for self hosted instances.");
|
||||
}
|
||||
}
|
||||
|
||||
public bool VerifyOrganizationPlan(Organization organization)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool VerifyUserPremium(User user)
|
||||
{
|
||||
return user.Premium;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user