Skip to content

Commit

Permalink
Merge branch 'release/PTE' into release/AppSource
Browse files Browse the repository at this point in the history
  • Loading branch information
vody committed Jul 4, 2023
2 parents 1d15e7d + d54aee2 commit e25962d
Show file tree
Hide file tree
Showing 21 changed files with 51 additions and 50 deletions.
3 changes: 2 additions & 1 deletion DOCS/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
<!---for any bug fixes--->
- Extension somehow breaks other extensions install [#18](https://github.com/thetanz/OpenFeature-al/issues/18)
- InherentPermissions to simplify permissions [#13](https://github.com/thetanz/OpenFeature-al/issues/13)
### Added
<!---for new features--->
-
Expand All @@ -22,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-
### Removed
<!---for now removed features--->
-
- `Basic_FF_TSL` permissions set extension now handled using InherentPermissions
### Security
<!---in case of vulnerabilities--->
-
Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/ConditionFunctions/CompanyFilterCondFunc.Codeunit.al
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
codeunit 70254349 "CompanyFilterCondFunc_FF_TSL" implements IConditionFunction_FF_TSL
{
Access = Internal;
InherentEntitlements = X;
InherentPermissions = X;
Permissions =
tabledata Company = R;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
codeunit 70254350 "SecGroupFilterCondFunc_FF_TSL" implements IConditionFunction_FF_TSL
{
Access = Internal;
InherentEntitlements = X;
InherentPermissions = X;
Permissions =
tabledata "Security Group Member Buffer" = R;

Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/ConditionFunctions/UserFilterCondFunc.Codeunit.al
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
codeunit 70254348 "UserFilterCondFunc_FF_TSL" implements IConditionFunction_FF_TSL
{
Access = Internal;
InherentEntitlements = X;
InherentPermissions = X;
Permissions =
tabledata User = R;

Expand Down
4 changes: 4 additions & 0 deletions MAIN/src/Conditions/Condition.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ table 70254347 "Condition_FF_TSL"
DataPerCompany = false;
Caption = 'Condition';
LookupPageId = Conditions_FF_TSL;
InherentEntitlements = RIMDX;
InherentPermissions = R;
Permissions =
tabledata FeatureCondition_FF_TSL = D;

fields
{
Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/Conditions/Conditions.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ page 70254347 "Conditions_FF_TSL"
DelayedInsert = true;
RefreshOnActivate = true;
Extensible = false;
InherentEntitlements = X;
InherentPermissions = X;

layout
{
Expand Down
5 changes: 2 additions & 3 deletions MAIN/src/FeatureConditions/ConditionsInUse.Query.al
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ query 70254345 "ConditionsInUse_FF_TSL"
Access = Internal;
QueryType = Normal;
ReadState = ReadUncommitted;
Permissions =
tabledata Condition_FF_TSL = R,
tabledata FeatureCondition_FF_TSL = R;
InherentEntitlements = X;
InherentPermissions = X;

elements
{
Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/FeatureConditions/FeatureCondFactbox.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ page 70254348 "FeatureCondFactbox_FF_TSL"
ApplicationArea = All;
Caption = 'Conditions';
Extensible = false;
InherentEntitlements = X;
InherentPermissions = X;

layout
{
Expand Down
5 changes: 3 additions & 2 deletions MAIN/src/FeatureConditions/FeatureCondition.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ table 70254348 "FeatureCondition_FF_TSL"
DataPerCompany = false;
LookupPageId = FeatureConditions_FF_TSL;
Caption = 'Feature Flag Condition';
InherentEntitlements = RIMDX;
InherentPermissions = R;

fields
{
field(1; FeatureID; Code[50])
{
Caption = 'Feature Flag Key';
Caption = 'Feature ID';
DataClassification = CustomerContent;
NotBlank = true;
TableRelation = Feature_FF_TSL;
ValidateTableRelation = false;
}
field(2; ConditionCode; Code[50])
{
Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/FeatureConditions/FeatureConditions.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ page 70254349 "FeatureConditions_FF_TSL"
ApplicationArea = All;
RefreshOnActivate = true;
Extensible = false;
InherentEntitlements = X;
InherentPermissions = X;

layout
{
Expand Down
4 changes: 2 additions & 2 deletions MAIN/src/FeatureConditions/ValidFeatures.Query.al
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ query 70254346 "ValidFeatures_FF_TSL"
Access = Internal;
QueryType = Normal;
ReadState = ReadUncommitted;
Permissions =
tabledata FeatureCondition_FF_TSL = R;
InherentEntitlements = X;
InherentPermissions = X;

elements
{
Expand Down
3 changes: 2 additions & 1 deletion MAIN/src/Features/Feature.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ table 70254345 "Feature_FF_TSL"
DataPerCompany = false;
Caption = 'Feature';
LookupPageId = Features_FF_TSL;
Permissions = tabledata Provider_FF_TSL = R;
InherentEntitlements = RIMDX;
InherentPermissions = R;

fields
{
Expand Down
9 changes: 5 additions & 4 deletions MAIN/src/Features/FeatureMgt.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ codeunit 70254347 "FeatureMgt_FF_TSL"
{
Access = Public;
SingleInstance = true;
InherentEntitlements = X;
InherentPermissions = X;
Permissions =
tabledata Provider_FF_TSL = RIM,
tabledata Feature_FF_TSL = RIM,
tabledata User = R,
tabledata "User Personalization" = R,
tabledata "All Profile" = R,
Expand All @@ -14,10 +14,9 @@ codeunit 70254347 "FeatureMgt_FF_TSL"
TempGlobalFeature: Record Feature_FF_TSL temporary;
TempUserSettings: Record "User Settings" temporary;
ProviderData: Dictionary of [Text, JsonObject];
GlobalContextAttributesContextID: Text;
GlobalContextAttributesContextID, EnabledFeatureIds : Text;
GlobalContextAttributes: JsonObject;
DefaultProfileID: Code[30];
EnabledFeatureIds: Text;

#region Library

Expand All @@ -37,6 +36,7 @@ codeunit 70254347 "FeatureMgt_FF_TSL"
end;

[NonDebuggable]
[InherentPermissions(PermissionObjectType::TableData, Database::Provider_FF_TSL, 'IM')]
internal procedure AddProvider(Code: Code[20]; Type: Enum ProviderType_FF_TSL; ConnectionInfo: JsonObject; CaptureEvents: JsonObject) Result: Boolean
var
Provider: Record Provider_FF_TSL;
Expand Down Expand Up @@ -71,6 +71,7 @@ codeunit 70254347 "FeatureMgt_FF_TSL"
exit(AddFeature(Feature, FeatureID, Description, ProviderCode))
end;

[InherentPermissions(PermissionObjectType::TableData, Database::Feature_FF_TSL, 'IM')]
local procedure AddFeature(var Feature: Record Feature_FF_TSL; FeatureID: Code[50]; Description: Text; ProviderCode: Code[20]) Result: Boolean
begin
Feature.Init();
Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/Features/Features.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ page 70254345 "Features_FF_TSL"
RefreshOnActivate = true;
InsertAllowed = false;
DeleteAllowed = false;
InherentEntitlements = X;
InherentPermissions = X;

layout
{
Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/Install.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ codeunit 70254345 "Install_FF_TSL"
{
Access = Internal;
Subtype = Install;
InherentEntitlements = X;
InherentPermissions = X;

trigger OnInstallAppPerDatabase()
var
Expand Down
10 changes: 8 additions & 2 deletions MAIN/src/Providers/ConditionProvider.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ codeunit 70254351 "ConditionProvider_FF_TSL" implements IProvider_FF_TSL
{
Access = Public;
SingleInstance = true;
InherentEntitlements = X;
InherentPermissions = X;
Permissions =
tabledata Condition_FF_TSL = RI,
tabledata FeatureCondition_FF_TSL = RID;
tabledata User = R;

var
FeatureMgt: Codeunit FeatureMgt_FF_TSL;
Expand All @@ -20,6 +21,7 @@ codeunit 70254351 "ConditionProvider_FF_TSL" implements IProvider_FF_TSL
exit(FeatureMgt.AddFeature(FeatureID, Description, ConditionProviderCodeTxt))
end;

[InherentPermissions(PermissionObjectType::TableData, Database::Condition_FF_TSL, 'I')]
procedure AddCondition(Code: Code[50]; Function: Enum ConditionFunction_FF_TSL; Argument: Text) Result: Boolean
var
Condition: Record Condition_FF_TSL;
Expand All @@ -32,6 +34,7 @@ codeunit 70254351 "ConditionProvider_FF_TSL" implements IProvider_FF_TSL
end
end;

[InherentPermissions(PermissionObjectType::TableData, Database::FeatureCondition_FF_TSL, 'IM')]
procedure AddFeatureCondition(FeatureID: Code[50]; ConditionCode: Code[50]) Result: Boolean
var
FeatureCondition: Record FeatureCondition_FF_TSL;
Expand Down Expand Up @@ -86,6 +89,8 @@ codeunit 70254351 "ConditionProvider_FF_TSL" implements IProvider_FF_TSL
StrmenuOptionLbl: Label '%1,Everyone', Comment = '%1 = User ID';
StrmenuResult: Integer;
begin
if not FeatureCondition.WritePermission() then
exit;
if not FeatureMgt.IsEnabled(FeatureID) then begin
StrmenuResult := StrMenu(StrSubstNo(StrmenuOptionLbl, UserId()), 0, StrmenuInstructionLbl);
if StrmenuResult > 0 then begin
Expand Down Expand Up @@ -204,6 +209,7 @@ codeunit 70254351 "ConditionProvider_FF_TSL" implements IProvider_FF_TSL
#region Subscribers

[EventSubscriber(ObjectType::Table, Database::Feature_FF_TSL, OnAfterDeleteEvent, '', false, false)]
[InherentPermissions(PermissionObjectType::TableData, Database::FeatureCondition_FF_TSL, 'D')]
local procedure OnDeleteFeature(var Rec: Record Feature_FF_TSL; RunTrigger: Boolean)
var
FeatureCondition: Record FeatureCondition_FF_TSL;
Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/Providers/PostHogProvider.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ codeunit 70254353 "PostHogProvider_FF_TSL" implements IProvider_FF_TSL
{
Access = Public;
SingleInstance = true;
InherentEntitlements = X;
InherentPermissions = X;
Permissions =
tabledata User = R;

Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/Providers/Provider.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ table 70254346 "Provider_FF_TSL"
Access = Internal;
DataClassification = SystemMetadata;
DataPerCompany = false;
InherentEntitlements = RIMDX;
InherentPermissions = R;

fields
{
Expand Down
2 changes: 2 additions & 0 deletions MAIN/src/Upgrade.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ codeunit 70254346 "Upgrade_FF_TSL"
{
Access = Internal;
Subtype = Upgrade;
InherentEntitlements = X;
InherentPermissions = X;

trigger OnUpgradePerDatabase()
var
Expand Down
8 changes: 1 addition & 7 deletions MAIN/src/permissionsetextension/Admin.PermissionSetExt.al
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ permissionsetextension 70254346 "Admin_FF_TSL" extends "Feature Mgt. - Admin"
Permissions =
// Conditions
tabledata Condition_FF_TSL = RIMD,
page Conditions_FF_TSL = X,
// FeatureConditions
page FeatureCondFactbox_FF_TSL = X,
tabledata FeatureCondition_FF_TSL = RIMD,
page FeatureConditions_FF_TSL = X,
// Features
tabledata Feature_FF_TSL = R,
page Features_FF_TSL = X;
tabledata FeatureCondition_FF_TSL = RIMD;
}
28 changes: 0 additions & 28 deletions MAIN/src/permissionsetextension/Basic.PermissionSetExt.al

This file was deleted.

0 comments on commit e25962d

Please sign in to comment.