mirror of
https://github.com/bitwarden/server.git
synced 2025-04-09 07:08:15 -05:00
42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using Bit.Core.Models.Table;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using System;
|
|
using Bit.Core.Models.Business;
|
|
using System.Threading.Tasks;
|
|
|
|
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 Task<bool> ValidateUserPremiumAsync(User user)
|
|
{
|
|
return Task.FromResult(user.Premium);
|
|
}
|
|
|
|
public byte[] SignLicense(ILicense license)
|
|
{
|
|
return new byte[0];
|
|
}
|
|
}
|
|
}
|