From 80e8dee77286bfb92c648d11cd04606a540e7cc9 Mon Sep 17 00:00:00 2001 From: "FENWICK\\ben.plunkett" <42510084+BenPlunk@users.noreply.github.com> Date: Tue, 3 Mar 2026 18:03:11 +1100 Subject: [PATCH 1/2] Added new permission APIs --- .../app/src/pages/APIV2AccessControl.Page.al | 96 ++++++++++++++++ .../src/pages/APIV2AutSecGrMembers.Page.al | 8 ++ .../src/pages/APIV2AutSecurityGroups.Page.al | 20 ++++ .../pages/APIV2ExpandedPermissionSets.Page.al | 107 ++++++++++++++++++ .../app/src/pages/APIV2PermissionSets.Page.al | 67 +++++++++++ .../src/pages/APIV2UserPermissionSets.Page.al | 80 +++++++++++++ .../src/pages/APIV2UsersPermissions.Page.al | 94 +++++++++++++++ 7 files changed, 472 insertions(+) create mode 100644 Apps/W1/APIV2/app/src/pages/APIV2AccessControl.Page.al create mode 100644 Apps/W1/APIV2/app/src/pages/APIV2ExpandedPermissionSets.Page.al create mode 100644 Apps/W1/APIV2/app/src/pages/APIV2PermissionSets.Page.al create mode 100644 Apps/W1/APIV2/app/src/pages/APIV2UserPermissionSets.Page.al create mode 100644 Apps/W1/APIV2/app/src/pages/APIV2UsersPermissions.Page.al diff --git a/Apps/W1/APIV2/app/src/pages/APIV2AccessControl.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2AccessControl.Page.al new file mode 100644 index 0000000000..75fce4ef76 --- /dev/null +++ b/Apps/W1/APIV2/app/src/pages/APIV2AccessControl.Page.al @@ -0,0 +1,96 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace System.Security.AccessControl; + +page 2149 "APIV2 - Access Control" +{ + APIGroup = 'automation'; + APIPublisher = 'microsoft'; + APIVersion = 'v2.0'; + EntityCaption = 'Access Control'; + EntitySetCaption = 'Access Controls'; + EntityName = 'accessControl'; + EntitySetName = 'accessControls'; + Editable = false; + DeleteAllowed = false; + InsertAllowed = false; + ModifyAllowed = false; + PageType = API; + SourceTable = "Access Control"; + ODataKeyFields = SystemId; + DataAccessIntent = ReadOnly; + + layout + { + area(Content) + { + repeater(Control1) + { + field(id; Rec.SystemId) + { + Caption = 'Id'; + } + field(userSecurityID; Rec."User Security ID") + { + Caption = 'User Security ID'; + } + field(roleID; Rec."Role ID") + { + Caption = 'Role ID'; + } + field(roleName; Rec."Role Name") + { + Caption = 'Role Name'; + } + field(company; Rec."Company Name") + { + Caption = 'Company'; + } + field(userName; Rec."User Name") + { + Caption = 'User Name'; + } + field(fullName; UserFullName) + { + Caption = 'Full Name'; + } + field(userLicenseType; UserLicenseType) + { + Caption = 'User License Type'; + } + field(scope; Rec.Scope) + { + Caption = 'Scope'; + } + field(appID; Rec."App ID") + { + Caption = 'App ID'; + } + field(appName; Rec."App Name") + { + Caption = 'App Name'; + } + } + } + } + + var + User: Record User; + UserFullName: Text; + UserLicenseType: Text; + + trigger OnAfterGetRecord() + begin + User.SetLoadFields("Full Name", "License Type"); + if User."User Security ID" <> Rec."User Security ID" then + if User.Get(Rec."User Security ID") then begin + UserFullName := User."Full Name"; + UserLicenseType := Format(User."License Type"); + end else begin + UserFullName := ''; + UserLicenseType := ''; + end; + end; +} \ No newline at end of file diff --git a/Apps/W1/APIV2/app/src/pages/APIV2AutSecGrMembers.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2AutSecGrMembers.Page.al index 8068522e33..f46681b424 100644 --- a/Apps/W1/APIV2/app/src/pages/APIV2AutSecGrMembers.Page.al +++ b/Apps/W1/APIV2/app/src/pages/APIV2AutSecGrMembers.Page.al @@ -43,6 +43,14 @@ page 30081 "APIV2 - Aut. Sec. Gr. Members" Editable = false; Caption = 'Security Group Name'; } + field(userName; Rec."User Name") + { + Caption = 'User Name'; + } + field(userFullName; Rec."User Full Name") + { + Caption = 'User Full Name'; + } } } } diff --git a/Apps/W1/APIV2/app/src/pages/APIV2AutSecurityGroups.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2AutSecurityGroups.Page.al index 5664124b2e..c8e0456088 100644 --- a/Apps/W1/APIV2/app/src/pages/APIV2AutSecurityGroups.Page.al +++ b/Apps/W1/APIV2/app/src/pages/APIV2AutSecurityGroups.Page.al @@ -42,6 +42,18 @@ page 30082 "APIV2 - Aut. Security Groups" Caption = 'Group Name'; Editable = false; } + field(groupUserSecurityID; Rec."Group User SID") + { + Caption = 'Group User Security Id'; + } + field(groupId; Rec."Group ID") + { + Caption = 'Group Id'; + } + field(retrievedSuccessfully; Rec."Retrieved Successfully") + { + Caption = 'Retrieved Successfully'; + } part(securityGroupMembers; "APIV2 - Aut. Sec. Gr. Members") { Caption = 'User Group Member'; @@ -56,6 +68,14 @@ page 30082 "APIV2 - Aut. Security Groups" EntitySetName = 'userPermissions'; SubPageLink = "User Security ID" = field("Group User SID"); } + part(permissionSets; "APIV2 - Access Control") + { + Caption = 'Permission Sets'; + EntityName = 'accessControl'; + EntitySetName = 'accessControls'; + Multiplicity = Many; + SubPageLink = "User Security ID" = field("Group User SID"); + } } } } diff --git a/Apps/W1/APIV2/app/src/pages/APIV2ExpandedPermissionSets.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2ExpandedPermissionSets.Page.al new file mode 100644 index 0000000000..ecccb7eeee --- /dev/null +++ b/Apps/W1/APIV2/app/src/pages/APIV2ExpandedPermissionSets.Page.al @@ -0,0 +1,107 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace System.Security.AccessControl; + +using System.Apps; + +page 20766 "APIV2 Expanded Permission Sets" +{ + APIGroup = 'auditing'; + APIPublisher = 'microsoft'; + APIVersion = 'v2.0'; + EntityCaption = 'Expanded Permission Set'; + EntitySetCaption = 'Expanded Permission Sets'; + EntityName = 'expandedPermissionSet'; + EntitySetName = 'expandedPermissionSets'; + Editable = false; + DeleteAllowed = false; + InsertAllowed = false; + ModifyAllowed = false; + DataAccessIntent = ReadOnly; + PageType = API; + SourceTable = "Expanded Permission"; + ODataKeyFields = SystemId; + + layout + { + area(Content) + { + repeater(Control1) + { + field(id; Rec.SystemId) + { + Caption = 'Id'; + } + field(appID; Rec."App ID") + { + Caption = 'App ID'; + } + field(appName; AppName) + { + Caption = 'App Name'; + } + field(roleID; Rec."Role ID") + { + Caption = 'Role ID'; + } + field(roleName; Rec."Role Name") + { + Caption = 'Role Name'; + } + field(objectType; Rec."Object Type") + { + Caption = 'Object Type'; + } + field(objectID; Rec."Object ID") + { + Caption = 'Object ID'; + } + field(objectName; Rec."Object Name") + { + Caption = 'Object Name'; + } + field(readPermission; Rec."Read Permission") + { + Caption = 'Read Permission'; + } + field(insertPermission; Rec."Insert Permission") + { + Caption = 'Insert Permission'; + } + field(modifyPermission; Rec."Modify Permission") + { + Caption = 'Modify Permission'; + } + field(deletePermission; Rec."Delete Permission") + { + Caption = 'Delete Permission'; + } + field(executePermission; Rec."Execute Permission") + { + Caption = 'Execute Permission'; + } + field(alObjectName; Rec."AL Object Name") + { + Caption = 'AL Object Name'; + } + field(scope; Rec.Scope) + { + Caption = 'Scope'; + } + } + } + } + + var + ExtensionManagement: Codeunit "Extension Management"; + AppName: Text; + + trigger OnAfterGetRecord() + begin + Clear(AppName); + if not IsNullGuid(Rec."App ID") then + AppName := ExtensionManagement.GetAppName(Rec."App ID"); + end; +} diff --git a/Apps/W1/APIV2/app/src/pages/APIV2PermissionSets.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2PermissionSets.Page.al new file mode 100644 index 0000000000..77aefca95c --- /dev/null +++ b/Apps/W1/APIV2/app/src/pages/APIV2PermissionSets.Page.al @@ -0,0 +1,67 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace System.Security.AccessControl; + +page 30003 "APIV2 - Permission Sets" +{ + APIGroup = 'automation'; + APIPublisher = 'microsoft'; + APIVersion = 'v2.0'; + EntityCaption = 'Permission Set'; + EntitySetCaption = 'Permission Sets'; + EntityName = 'aggregatePermissionSet'; + EntitySetName = 'aggregatePermissionSets'; + Editable = false; + DeleteAllowed = false; + InsertAllowed = false; + ModifyAllowed = false; + DataAccessIntent = ReadOnly; + PageType = API; + SourceTable = "Aggregate Permission Set"; + SourceTableView = where("App Name" = filter('<> *_Exclude_*')); + ODataKeyFields = SystemId; + + layout + { + area(Content) + { + repeater(Control1) + { + field(id; Rec.SystemId) + { + Caption = 'Id'; + } + field(appID; Rec."App ID") + { + Caption = 'App Id'; + } + field(appName; Rec."App Name") + { + Caption = 'App Name'; + } + field(name; Rec.Name) + { + Caption = 'Name'; + } + field(roleID; Rec."Role ID") + { + Caption = 'Role Id'; + } + field(scope; Rec.Scope) + { + Caption = 'Scope'; + } + part(accessControl; "APIV2 - Access Control") + { + Caption = 'Access Control'; + EntityName = 'accessControl'; + EntitySetName = 'accessControls'; + Multiplicity = Many; + SubPageLink = "Role ID" = field("Role ID"); + } + } + } + } +} \ No newline at end of file diff --git a/Apps/W1/APIV2/app/src/pages/APIV2UserPermissionSets.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2UserPermissionSets.Page.al new file mode 100644 index 0000000000..c86069c622 --- /dev/null +++ b/Apps/W1/APIV2/app/src/pages/APIV2UserPermissionSets.Page.al @@ -0,0 +1,80 @@ + +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace System.Security.AccessControl; + +page 30058 "APIV2 - User Permission Sets" +{ + APIGroup = 'automation'; + APIPublisher = 'microsoft'; + APIVersion = 'v2.0'; + EntityCaption = 'User Permission Set'; + EntitySetCaption = 'User Permission Sets'; + EntityName = 'userPermissionSet'; + EntitySetName = 'userPermissionSets'; + Editable = false; + DeleteAllowed = false; + InsertAllowed = false; + ModifyAllowed = false; + DataAccessIntent = ReadOnly; + PageType = API; + SourceTable = "User Permissions Buffer"; + ODataKeyFields = SystemId; + + layout + { + area(Content) + { + repeater(Control1) + { + field(id; Rec.SystemId) + { + Caption = 'Id'; + } + field(userSecurityID; Rec."User Security ID") + { + Caption = 'User Security ID'; + } + field(type; Rec.Type) + { + Caption = 'Type'; + } + field(roleID; Rec."Role ID") + { + Caption = 'Role ID'; + } + field(roleName; Rec."Role Name") + { + Caption = 'Role Name'; + } + field(securityGroupCode; Rec.SecurityGroupCode) + { + Caption = 'Security Group Code'; + } + field(company; Rec."Company Name") + { + Caption = 'Company'; + } + field(scope; Rec.Scope) + { + Caption = 'Scope'; + } + field(appID; Rec."App ID") + { + Caption = 'App ID'; + } + field(appName; Rec."App Name") + { + Caption = 'App Name'; + } + } + } + } + + trigger OnInit() + begin + Rec.FillBuffer(); + end; +} diff --git a/Apps/W1/APIV2/app/src/pages/APIV2UsersPermissions.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2UsersPermissions.Page.al new file mode 100644 index 0000000000..556d1b03df --- /dev/null +++ b/Apps/W1/APIV2/app/src/pages/APIV2UsersPermissions.Page.al @@ -0,0 +1,94 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace System.Security.AccessControl; +page 30099 "APIV2 - Users Permissions" +{ + APIGroup = 'automation'; + APIPublisher = 'microsoft'; + APIVersion = 'v2.0'; + EntityCaption = 'User Permission'; + EntitySetCaption = 'User Permissions'; + EntityName = 'usersPermission'; + EntitySetName = 'usersPermissions'; + Editable = false; + DeleteAllowed = false; + InsertAllowed = false; + ModifyAllowed = false; + DataAccessIntent = ReadOnly; + PageType = API; + SourceTable = User; + SourceTableView = where("License Type" = filter('Full User|Limited User|Device Only User|External User|External Administrator|External Accountant')); + ODataKeyFields = SystemId; + + layout + { + area(Content) + { + repeater(Control1) + { + field(id; Rec.SystemId) + { + Caption = 'Id'; + } + field(userSecurityID; Rec."User Security ID") + { + Caption = 'User Security Id'; + } + field(userName; Rec."User Name") + { + Caption = 'User Name'; + } + field(fullName; Rec."Full Name") + { + Caption = 'Full Name'; + } + field(state; Rec.State) + { + Caption = 'State'; + } + field(expiryDate; Rec."Expiry Date") + { + Caption = 'Expiry Date'; + } + field(windowsSecurityID; Rec."Windows Security ID") + { + Caption = 'Windows Security Id'; + } + field(changePassword; Rec."Change Password") + { + Caption = 'Change Password'; + } + field(licenseType; Rec."License Type") + { + Caption = 'License Type'; + } + field(authenticationEmail; Rec."Authentication Email") + { + Caption = 'Authentication Email'; + } + field(contactEmail; Rec."Contact Email") + { + Caption = 'Contact Email'; + } + field(exchangeIdentifier; Rec."Exchange Identifier") + { + Caption = 'Exchange Identifier'; + } + field(applicationID; Rec."Application ID") + { + Caption = 'Application Id'; + } + part(userPermissionSets; "APIV2 - User Permission Sets") + { + Caption = 'User Permission Sets'; + EntityName = 'userPermissionSet'; + EntitySetName = 'userPermissionSets'; + Multiplicity = Many; + SubPageLink = "User Security ID" = field("User Security ID"); + } + } + } + } +} \ No newline at end of file From 3370027e23106475dddf381165170d32f0a92bf3 Mon Sep 17 00:00:00 2001 From: "FENWICK\\ben.plunkett" <42510084+BenPlunk@users.noreply.github.com> Date: Tue, 3 Mar 2026 18:25:01 +1100 Subject: [PATCH 2/2] Minor updates --- Apps/W1/APIV2/app/src/pages/APIV2AccessControl.Page.al | 2 +- .../W1/APIV2/app/src/pages/APIV2ExpandedPermissionSets.Page.al | 3 ++- Apps/W1/APIV2/app/src/pages/APIV2PermissionSets.Page.al | 2 +- Apps/W1/APIV2/app/src/pages/APIV2UserPermissionSets.Page.al | 2 +- Apps/W1/APIV2/app/src/pages/APIV2UsersPermissions.Page.al | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Apps/W1/APIV2/app/src/pages/APIV2AccessControl.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2AccessControl.Page.al index 75fce4ef76..dbbca7c9cc 100644 --- a/Apps/W1/APIV2/app/src/pages/APIV2AccessControl.Page.al +++ b/Apps/W1/APIV2/app/src/pages/APIV2AccessControl.Page.al @@ -26,7 +26,7 @@ page 2149 "APIV2 - Access Control" { area(Content) { - repeater(Control1) + repeater(Group) { field(id; Rec.SystemId) { diff --git a/Apps/W1/APIV2/app/src/pages/APIV2ExpandedPermissionSets.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2ExpandedPermissionSets.Page.al index ecccb7eeee..8bea2db913 100644 --- a/Apps/W1/APIV2/app/src/pages/APIV2ExpandedPermissionSets.Page.al +++ b/Apps/W1/APIV2/app/src/pages/APIV2ExpandedPermissionSets.Page.al @@ -22,13 +22,14 @@ page 20766 "APIV2 Expanded Permission Sets" DataAccessIntent = ReadOnly; PageType = API; SourceTable = "Expanded Permission"; + SourceTableView = where(Ap = filter('<> Exclude')); ODataKeyFields = SystemId; layout { area(Content) { - repeater(Control1) + repeater(Group) { field(id; Rec.SystemId) { diff --git a/Apps/W1/APIV2/app/src/pages/APIV2PermissionSets.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2PermissionSets.Page.al index 77aefca95c..bf1d6568f8 100644 --- a/Apps/W1/APIV2/app/src/pages/APIV2PermissionSets.Page.al +++ b/Apps/W1/APIV2/app/src/pages/APIV2PermissionSets.Page.al @@ -27,7 +27,7 @@ page 30003 "APIV2 - Permission Sets" { area(Content) { - repeater(Control1) + repeater(Group) { field(id; Rec.SystemId) { diff --git a/Apps/W1/APIV2/app/src/pages/APIV2UserPermissionSets.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2UserPermissionSets.Page.al index c86069c622..40d84a3f45 100644 --- a/Apps/W1/APIV2/app/src/pages/APIV2UserPermissionSets.Page.al +++ b/Apps/W1/APIV2/app/src/pages/APIV2UserPermissionSets.Page.al @@ -27,7 +27,7 @@ page 30058 "APIV2 - User Permission Sets" { area(Content) { - repeater(Control1) + repeater(Group) { field(id; Rec.SystemId) { diff --git a/Apps/W1/APIV2/app/src/pages/APIV2UsersPermissions.Page.al b/Apps/W1/APIV2/app/src/pages/APIV2UsersPermissions.Page.al index 556d1b03df..fdae6cb79c 100644 --- a/Apps/W1/APIV2/app/src/pages/APIV2UsersPermissions.Page.al +++ b/Apps/W1/APIV2/app/src/pages/APIV2UsersPermissions.Page.al @@ -26,7 +26,7 @@ page 30099 "APIV2 - Users Permissions" { area(Content) { - repeater(Control1) + repeater(Group) { field(id; Rec.SystemId) {