Skip to content

Commit

Permalink
FIrst version upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc van Vugt committed Nov 27, 2023
1 parent a6d9d71 commit f21ad87
Show file tree
Hide file tree
Showing 11 changed files with 281 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ rad.json
.snapshots/
cache_*
~$*
**//.vs/
**/.vscode/**
!**/.vscode/settings.json
7 changes: 7 additions & 0 deletions App/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"CRS.ObjectNameSuffix": " FLX",
"CRS.FileNamePattern": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.FileNamePatternExtensions": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.ExtensionObjectNamePattern": "",
"CRS.RemoveSuffixFromFilename": true
}
32 changes: 32 additions & 0 deletions App/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"id": "503632db-9392-4d1a-b6e0-770f167b3556",
"name": "TestPermissionTest app",
"publisher": "fluxxus.nl",
"version": "1.0.0.0",
"brief": "",
"description": "",
"privacyStatement": "",
"EULA": "",
"help": "",
"url": "",
"logo": "",
"dependencies": [],
"screenshots": [],
"platform": "1.0.0.0",
"application": "23.0.0.0",
"idRanges": [
{
"from": 84100,
"to": 84149
}
],
"resourceExposurePolicy": {
"allowDebugging": true,
"allowDownloadingSource": true,
"includeSourceInSymbolFile": true
},
"runtime": "12.0",
"features": [
"NoImplicitWith"
]
}
7 changes: 7 additions & 0 deletions App/src/permissionset/TestPermissions.PermissionSet.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
permissionset 84100 "Test Permissions FLX"
{
Assignable = true;
Caption = 'Test Permissions';

Permissions = tabledata "Test Table FLX" = RIDM;
}
20 changes: 20 additions & 0 deletions App/src/table/TestTable.Table.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
table 84100 "Test Table FLX"
{
DataClassification = ToBeClassified;
Caption = 'Test Table';

fields
{
field(1; "Code"; Code[10])
{
DataClassification = ToBeClassified;
Caption = 'Code';

}
field(2; Description; Text[100])
{
DataClassification = ToBeClassified;
Caption = 'Description';
}
}
}
7 changes: 7 additions & 0 deletions Test/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"CRS.ObjectNameSuffix": " FLX",
"CRS.FileNamePattern": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.FileNamePatternExtensions": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.ExtensionObjectNamePattern": "",
"CRS.RemoveSuffixFromFilename": true
}
69 changes: 69 additions & 0 deletions Test/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"id": "4d5aa84e-5883-4b93-8f5c-7c4f09902cd7",
"name": "TestPermissionTest test app",
"publisher": "fluxxus.nl",
"version": "1.0.0.0",
"brief": "",
"description": "",
"privacyStatement": "",
"EULA": "",
"help": "",
"url": "",
"logo": "",
"dependencies": [
{
"id": "503632db-9392-4d1a-b6e0-770f167b3556",
"publisher": "fluxxus.nl",
"version": "1.0.0.0",
"name": "TestPermissionTest app"
},
{
"id": "e7320ebb-08b3-4406-b1ec-b4927d3e280b",
"publisher": "Microsoft",
"version": "23.0.0.0",
"name": "Any"
},
{
"id": "dd0be2ea-f733-4d65-bb34-a28f4624fb14",
"publisher": "Microsoft",
"version": "23.0.0.0",
"name": "Library Assert"
},
{
"id": "5095f467-0a01-4b99-99d1-9ff1237d286f",
"publisher": "Microsoft",
"version": "23.0.0.0",
"name": "Library Variable Storage"
},
{
"id": "5d86850b-0d76-4eca-bd7b-951ad998e997",
"publisher": "Microsoft",
"version": "23.0.0.0",
"name": "Tests-TestLibraries"
},
{
"id": "23de40a6-dfe8-4f80-80db-d70f83ce8caf",
"name": "Test Runner",
"publisher": "Microsoft",
"version": "23.0.0.0"
}
],
"screenshots": [],
"platform": "1.0.0.0",
"application": "23.0.0.0",
"idRanges": [
{
"from": 84100,
"to": 84149
}
],
"resourceExposurePolicy": {
"allowDebugging": true,
"allowDownloadingSource": true,
"includeSourceInSymbolFile": true
},
"runtime": "12.0",
"features": [
"NoImplicitWith"
]
}
41 changes: 41 additions & 0 deletions Test/test/TestTPDisabled.Codeunit.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
codeunit 84100 "Test TP Disabled FLX"
{
Subtype = Test;
TestPermissions = Disabled;

[Test]
procedure TestTestPermissionsDisabled()
begin
Initialize();

CreateTestTable();
end;

var
Any: Codeunit "Any";
IsInitialized: Boolean;

local procedure Initialize()
var
LibraryTestInitialize: Codeunit "Library - Test Initialize";
begin
LibraryTestInitialize.OnTestInitialize(Codeunit::"Test TP Disabled FLX");

if IsInitialized then
exit;

LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"Test TP Disabled FLX");

IsInitialized := true;

LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"Test TP Disabled FLX");
end;

local procedure CreateTestTable()
var
TestTable: Record "Test Table FLX";
begin
TestTable.Code := Any.AlphabeticText(MaxStrLen(TestTable.Code));
TestTable.Insert();
end;
}
44 changes: 44 additions & 0 deletions Test/test/TestTPNonRestrictive.Codeunit.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
codeunit 84102 "Test TP NonRestrictive FLX"
{
Subtype = Test;
TestPermissions = NonRestrictive;

[Test]
procedure TestTestPermissionsNonRestrictive()
begin
Initialize();

CreateTestTable();
end;

var
Any: Codeunit "Any";
LibraryLowerTestPermissions: Codeunit "Library - Lower Permissions";
IsInitialized: Boolean;

local procedure Initialize()
var
LibraryTestInitialize: Codeunit "Library - Test Initialize";
begin
LibraryTestInitialize.OnTestInitialize(Codeunit::"Test TP NonRestrictive FLX");

if IsInitialized then
exit;

LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"Test TP NonRestrictive FLX");

LibraryLowerTestPermissions.AddPermissionSet('Test Permissions FLX');

IsInitialized := true;

LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"Test TP NonRestrictive FLX");
end;

local procedure CreateTestTable()
var
TestTable: Record "Test Table FLX";
begin
TestTable.Code := Any.AlphabeticText(MaxStrLen(TestTable.Code));
TestTable.Insert();
end;
}
44 changes: 44 additions & 0 deletions Test/test/TestTPRestrictive.Codeunit.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
codeunit 84101 "Test TP Restrictive FLX"
{
Subtype = Test;
TestPermissions = Restrictive;

[Test]
procedure TestTestPermissionsRestrictive()
begin
Initialize();

CreateTestTable();
end;

var
Any: Codeunit "Any";
LibraryLowerTestPermissions: Codeunit "Library - Lower Permissions";
IsInitialized: Boolean;

local procedure Initialize()
var
LibraryTestInitialize: Codeunit "Library - Test Initialize";
begin
LibraryTestInitialize.OnTestInitialize(Codeunit::"Test TP Restrictive FLX");

if IsInitialized then
exit;

LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"Test TP Restrictive FLX");

LibraryLowerTestPermissions.AddPermissionSet('Test Permissions FLX');

IsInitialized := true;

LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"Test TP Restrictive FLX");
end;

local procedure CreateTestTable()
var
TestTable: Record "Test Table FLX";
begin
TestTable.Code := Any.AlphabeticText(MaxStrLen(TestTable.Code));
TestTable.Insert();
end;
}
8 changes: 7 additions & 1 deletion al.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
"folders": [
{
"path": ".AL-Go"
}
},
{
"path": "./App"
},
{
"path": "./Test"
}
],
"settings": {}
}

0 comments on commit f21ad87

Please sign in to comment.