-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f7d7a4
commit 2ff2231
Showing
36 changed files
with
1,504 additions
and
634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
codeunit 71036 "SPBPL License Management" | ||
{ | ||
Permissions = tabledata "SPBPL Extension License" = RIM; | ||
ObsoleteState = Pending; | ||
ObsoleteReason = 'Refactored to new Method Codeunits and separate Event wrapper.'; | ||
|
||
[Obsolete('Use new Events in SPBPL Events codeunit.')] | ||
[IntegrationEvent(false, false)] | ||
local procedure OnAfterLicenseDeactivated(var SPBExtensionLicense: Record "SPBPL Extension License") | ||
begin | ||
end; | ||
|
||
[Obsolete('Use new Events in SPBPL Events codeunit.')] | ||
[IntegrationEvent(false, false)] | ||
local procedure OnAfterLicenseDeactivatedByPlatform(var SPBExtensionLicense: Record "SPBPL Extension License"; ResponseBody: Text) | ||
begin | ||
end; | ||
|
||
[Obsolete('Use new Events in SPBPL Events codeunit.')] | ||
[IntegrationEvent(false, false)] | ||
local procedure OnAfterActivationFailure(var SPBExtensionLicense: Record "SPBPL Extension License"; var AppInfo: ModuleInfo) | ||
begin | ||
end; | ||
|
||
[Obsolete('Use new Events in SPBPL Events codeunit.')] | ||
[IntegrationEvent(false, false)] | ||
local procedure OnBeforeVersionCheckUpgradeAvailable(var SPBExtensionLicense: Record "SPBPL Extension License"; var LatestVersion: Version; var IsHandled: Boolean) | ||
begin | ||
end; | ||
|
||
[Obsolete('Use new Events in SPBPL Events codeunit.')] | ||
[IntegrationEvent(false, false)] | ||
local procedure OnAfterActivationSuccess(var SPBExtensionLicense: Record "SPBPL Extension License"; var AppInfo: ModuleInfo) | ||
begin | ||
end; | ||
|
||
[Obsolete('Use new Events in SPBPL Events codeunit.')] | ||
[IntegrationEvent(false, false)] | ||
local procedure OnAfterVersionCheckFailure(var SPBExtensionLicense: Record "SPBPL Extension License"; var ApiHttpRespMessage: HttpResponseMessage) | ||
begin | ||
end; | ||
|
||
[Obsolete('Use new Events in SPBPL Events codeunit.')] | ||
[IntegrationEvent(false, false)] | ||
internal procedure OnAfterThrowPossibleMisuse(var SPBExtensionLicense: Record "SPBPL Extension License") | ||
begin | ||
end; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
permissionset 71033 "SPBPL Licensing" | ||
{ | ||
Assignable = true; | ||
Caption = 'Spare Brained Licensing Admin'; | ||
Permissions = table "SPBPL Extension License" = X, | ||
tabledata "SPBPL Extension License" = RMI, | ||
codeunit "SPBPL Activate Meth" = X, | ||
codeunit "SPBPL Check Active" = X, | ||
codeunit "SPBPL Check Active Meth" = X, | ||
codeunit "SPBPL Deactivate Meth" = X, | ||
codeunit "SPBPL Environment Watcher" = X, | ||
codeunit "SPBPL Events" = X, | ||
codeunit "SPBPL Extension Registration" = X, | ||
codeunit "SPBPL Gumroad Communicator" = X, | ||
codeunit "SPBPL IsoStore Manager" = X, | ||
codeunit "SPBPL LemonSqueezy Comm." = X, | ||
codeunit "SPBPL License Utilities" = X, | ||
codeunit "SPBPL Licensing Install" = X, | ||
codeunit "SPBPL Upgrade" = X, | ||
codeunit "SPBPL Version Check" = X, | ||
page "SPBPL Extension Licenses" = X, | ||
page "SPBPL License Activation" = X; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
permissionset 71034 "SPBPL Licensing RO" | ||
{ | ||
Assignable = true; | ||
Caption = 'SPBPL Licensing RO'; | ||
Permissions = table "SPBPL Extension License" = X, | ||
tabledata "SPBPL Extension License" = RMI, | ||
codeunit "SPBPL Activate Meth" = X, | ||
codeunit "SPBPL Check Active" = X, | ||
codeunit "SPBPL Check Active Meth" = X, | ||
codeunit "SPBPL Deactivate Meth" = X, | ||
codeunit "SPBPL Environment Watcher" = X, | ||
codeunit "SPBPL Events" = X, | ||
codeunit "SPBPL Extension Registration" = X, | ||
codeunit "SPBPL Gumroad Communicator" = X, | ||
codeunit "SPBPL IsoStore Manager" = X, | ||
codeunit "SPBPL LemonSqueezy Comm." = X, | ||
codeunit "SPBPL License Utilities" = X, | ||
codeunit "SPBPL Licensing Install" = X, | ||
codeunit "SPBPL Upgrade" = X, | ||
codeunit "SPBPL Version Check" = X, | ||
page "SPBPL Extension Licenses" = X, | ||
page "SPBPL License Activation" = X; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "Licensing ruleset", | ||
"description": "The ruleset to use for SBI Licensing", | ||
"rules": [ | ||
{ | ||
"id": "AA0240", | ||
"action": "None", | ||
"justification": "There are intentionally included email addresses for support with this extension." | ||
}, | ||
{ | ||
"id": "AA0072", | ||
"action": "None", | ||
"justification": "I need to use more generic variable names for easing cloning to a PTE." | ||
}, | ||
{ | ||
"id": "PTE0001", | ||
"action": "None", | ||
"justification": "<object> has an ID of [#######]. It must be between 50000 and 99999. Need to clarify licensing issues with VAR ID range" | ||
}, | ||
{ | ||
"id": "PTE0002", | ||
"action": "None", | ||
"justification": "<field in tableextension> has an ID of [#######]. It must be between 50000 and 99999. Need to clarify licensing issues with VAR ID range" | ||
}, | ||
{ | ||
"id": "AS0084", | ||
"action": "None", | ||
"justification": "Not Applicable - The ID range '[50000..99999]' is not valid. It must be within the range allocated to the partner for AppSource, within the range '[1000000..75999999]' allocated to AppSource applications, and outside the range '[50000..99999]' allocated to per-tenant customizations." | ||
}, | ||
{ | ||
"id": "AS0092", | ||
"action": "None", | ||
"justification": "For the public version, I'm not releasing my app insights key. You're welcome to include your own, of course, as telemetry was added in v1.2.0.0." | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/// <summary> | ||
/// This Codeunit is for checking basic active/inactive functions to be used by 3rd parties wanting to validate | ||
/// if a license is active. Two main options exist at this time - with or without Submodule functionality. | ||
/// </summary> | ||
codeunit 71042 "SPBPL Check Active" | ||
{ | ||
/// <summary> | ||
/// This function takes an App ID and checks if it is active or not, along with if the user should be shown errors if Inactive. | ||
/// </summary> | ||
/// <param name="SubscriptionId">This should be the App ID</param> | ||
/// <param name="InactiveShowError">If the extension is Inactive, should the user be shown an error?</param> | ||
/// <returns></returns> | ||
procedure CheckBasic(SubscriptionId: Guid; InactiveShowError: Boolean) IsActive: Boolean | ||
var | ||
SPBExtensionLicense: Record "SPBPL Extension License"; | ||
NoSubFoundErr: Label 'No License was found in the Licenses list for SubscriptionId: %1', Comment = '%1 is the ID of the App.'; | ||
begin | ||
SPBExtensionLicense.SetRange("Extension App Id"); | ||
//If using this function signature, the Submodule functionality should NOT be considered. | ||
SPBExtensionLicense.SetRange("Submodule Name", ''); | ||
if not SPBExtensionLicense.FindFirst() then | ||
if GuiAllowed() then | ||
Error(NoSubFoundErr, SubscriptionId); | ||
|
||
IsActive := DoCheckBasic(SPBExtensionLicense, InactiveShowError); | ||
end; | ||
|
||
/// <summary> | ||
/// This function takes an App ID and Submodule Name and checks if it is active or not, along with if the user should be shown errors if Inactive. | ||
/// </summary> | ||
/// <param name="SubscriptionId">This should be the App ID</param> | ||
/// <param name="SubmoduleName">This should be the submodule to check for</param> | ||
/// <param name="InactiveShowError">If the extension is Inactive, should the user be shown an error?</param> | ||
/// <returns></returns> | ||
procedure CheckBasicSubmodule(SubscriptionId: Guid; SubmoduleName: Text[100]; InactiveShowError: Boolean) IsActive: Boolean | ||
var | ||
SPBExtensionLicense: Record "SPBPL Extension License"; | ||
NoSubscriptionFoundErr: Label 'No License was found in the Licenses list for SubscriptionId: %1 with Submodule name: %2', Comment = '%1 is the ID of the App. %2 is the Submodule.'; | ||
begin | ||
SPBExtensionLicense.SetRange("Extension App Id"); | ||
SPBExtensionLicense.SetRange("Submodule Name", SubmoduleName); | ||
if not SPBExtensionLicense.FindFirst() then | ||
if GuiAllowed() then | ||
Error(NoSubscriptionFoundErr, SubscriptionId, SubmoduleName); | ||
|
||
IsActive := DoCheckBasic(SPBExtensionLicense, InactiveShowError); | ||
end; | ||
|
||
local procedure DoCheckBasic(var SPBExtensionLicense: Record "SPBPL Extension License"; InactiveShowError: Boolean): Boolean | ||
var | ||
SPBPLCheckActiveMeth: Codeunit "SPBPL Check Active Meth"; | ||
IsActive: Boolean; | ||
SubscriptionInactiveErr: Label 'The License for %1 is not Active. Contact your system administrator to re-activate it.', Comment = '%1 is the name of the Extension.'; | ||
begin | ||
IsActive := SPBPLCheckActiveMeth.CheckIfActive(SPBExtensionLicense); | ||
if not IsActive and InactiveShowError then | ||
if GuiAllowed() then | ||
Error(SubscriptionInactiveErr, SPBExtensionLicense."Extension Name"); | ||
exit(IsActive); | ||
end; | ||
} |
Oops, something went wrong.