I think I may have figured this one out.
On my module I've overriden the CheckLicense method as such:
public override bool CheckLicense(string domain, FeatureEnum feature, ObjectActionEnum action)
{
if (domain != null)
domain = LicenseKeyInfoProvider.ParseDomainName(domain);
int siteId = LicenseHelper.GetSiteIDbyDomain(domain);
var licenseKey = LicenseKeyInfoProvider.GetLicenseKeyInfo(domain, FeatureEnum.Unknown);
if (siteId > 0 && licenseKey != null)
{
// TODO: query external service with licenseKey.Domain for a valid license for this module
return true;
}
return false;
}
And then I can use:
ModuleManager.CheckModuleLicense("My.Module.Name", RequestContext.CurrentDomain, FeatureEnum.Unknown, ObjectActionEnum.Read)
On the features to ensure the module is properly licensed.
The method override is a simplification, I've implemented caching on the external services requests, to prevent having to query the service every time we want to check for permissions.
I'm also sending the licenseKey.Domain because we don't care about aliases, as long as the main domain is licensed the module should work under any aliases.
How does this approach looks? Would really appreciate any feedback from anyone that has done something of the sort, and what was the opted for solution?
Thanks,
p.
SiteDomainAliasInfoProvider
to get all aliases of a site...is that what you're looking for? – Micky