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

more premium licensing

This commit is contained in:
Kyle Spearrin
2017-08-11 22:55:25 -04:00
parent 73029f76d2
commit 9c254a7325
12 changed files with 126 additions and 59 deletions

View File

@ -0,0 +1,40 @@
using Bit.Core.Models.Table;
using Microsoft.AspNetCore.Hosting;
using System;
using Bit.Core.Models.Business;
namespace Bit.Core.Services
{
public class NoopLicensingService : ILicensingService
{
public NoopLicensingService(
IHostingEnvironment environment,
GlobalSettings globalSettings)
{
if(!environment.IsDevelopment() && globalSettings.SelfHosted)
{
throw new Exception($"{nameof(NoopLicensingService)} cannot be used for self hosted instances.");
}
}
public bool VerifyLicense(ILicense license)
{
return true;
}
public bool VerifyOrganizationPlan(Organization organization)
{
return true;
}
public bool VerifyUserPremium(User user)
{
return user.Premium;
}
public byte[] SignLicense(ILicense license)
{
return new byte[0];
}
}
}