I think I may have figured this out.
In my module, I redefined 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) {
And then I can use:
ModuleManager.CheckModuleLicense("My.Module.Name", RequestContext.CurrentDomain, FeatureEnum.Unknown, ObjectActionEnum.Read)
About features that ensure proper licensing of the module.
Overriding a method is a simplification; I implemented caching of external service requests to prevent a service request every time we want to check permissions.
I also send the license Key.Domain, because we are not interested in aliases, if the main domain is licensed, the module should work under any aliases.
What does this approach look like? Would really appreciate any feedback from those who did something similar, and what was chosen for the solution?
Thank you p.
source share