1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 09:02:48 -05:00

license verification services for user/org

This commit is contained in:
Kyle Spearrin
2017-08-09 17:01:37 -04:00
parent 3deec076c7
commit a1d064ed9e
26 changed files with 457 additions and 2 deletions

View File

@ -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;
}
}
}