diff --git a/src/System Application/App/Permission Sets/src/PermissionSet.Page.al b/src/System Application/App/Permission Sets/src/PermissionSet.Page.al index 8015403e96..72327e6d0c 100644 --- a/src/System Application/App/Permission Sets/src/PermissionSet.Page.al +++ b/src/System Application/App/Permission Sets/src/PermissionSet.Page.al @@ -119,6 +119,23 @@ page 9855 "Permission Set" AboutTitle = 'About view all permissions'; AboutText = 'View all permissions gives you the big picture. It opens a flat list of the permissions in the set you''re working with and all added sets'; } + action("Where-Used") + { + ApplicationArea = All; + Promoted = true; + PromotedOnly = true; + PromotedCategory = Process; + Image = Track; + Caption = 'Where-Used'; + ToolTip = 'View where this permission set is used, including which users and security groups have been assigned with it.'; + + trigger OnAction() + var + PermissionsOverviewCU: Codeunit "Permissions Overview"; + begin + PermissionsOverviewCU.OpenForPermissionSet(Rec."Role ID"); + end; + } group("Record Permissions") { Caption = 'Record Permissions'; diff --git a/src/System Application/App/Permission Sets/src/PermissionsOverview.Codeunit.al b/src/System Application/App/Permission Sets/src/PermissionsOverview.Codeunit.al new file mode 100644 index 0000000000..9284720099 --- /dev/null +++ b/src/System Application/App/Permission Sets/src/PermissionsOverview.Codeunit.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; + +/// +/// Provides procedures to open the Permissions Overview page with optional filters. +/// Raises integration events that allow the hosting application to handle the navigation. +/// +codeunit 9865 "Permissions Overview" +{ + Access = Public; + + /// + /// Opens the Permissions Overview page without any filters. + /// + procedure Open() + begin + OnOpenPermissionsOverview(); + end; + + /// + /// Opens the Permissions Overview page filtered to a specific permission set (Where-Used). + /// + /// The Role ID of the permission set to filter on. + procedure OpenForPermissionSet(RoleID: Text[30]) + begin + OnOpenPermissionsOverviewForPermissionSet(RoleID); + end; + + /// + /// Opens the Permissions Overview page filtered to a specific table. + /// + /// The table number to filter on. + procedure OpenForTable(TableNo: Integer) + begin + OnOpenPermissionsOverviewForTable(TableNo); + end; + + /// + /// Raised when the Permissions Overview page should be opened without filters. + /// + [IntegrationEvent(false, false)] + internal procedure OnOpenPermissionsOverview() + begin + end; + + /// + /// Raised when the Permissions Overview page should be opened filtered to a permission set. + /// + /// The Role ID to filter on. + [IntegrationEvent(false, false)] + internal procedure OnOpenPermissionsOverviewForPermissionSet(RoleID: Text[30]) + begin + end; + + /// + /// Raised when the Permissions Overview page should be opened filtered to a table. + /// + /// The table number to filter on. + [IntegrationEvent(false, false)] + internal procedure OnOpenPermissionsOverviewForTable(TableNo: Integer) + begin + end; +} diff --git a/src/System Application/App/Permission Sets/src/permissions/PermissionSetsObjects.PermissionSet.al b/src/System Application/App/Permission Sets/src/permissions/PermissionSetsObjects.PermissionSet.al index 14d8da1749..4edce53998 100644 --- a/src/System Application/App/Permission Sets/src/permissions/PermissionSetsObjects.PermissionSet.al +++ b/src/System Application/App/Permission Sets/src/permissions/PermissionSetsObjects.PermissionSet.al @@ -11,6 +11,7 @@ permissionset 9862 "Permission Sets - Objects" Assignable = false; Permissions = codeunit "Permission Set Relation" = X, + codeunit "Permissions Overview" = X, codeunit "Log Activity Permissions" = X, page "Expanded Permissions" = X, page "Expanded Permissions Factbox" = X, diff --git a/src/System Application/App/Table Information/app.json b/src/System Application/App/Table Information/app.json index 22eb6d7337..548c31318c 100644 --- a/src/System Application/App/Table Information/app.json +++ b/src/System Application/App/Table Information/app.json @@ -16,6 +16,12 @@ "name": "User Permissions", "publisher": "Microsoft", "version": "29.0.0.0" + }, + { + "id": "4992eeac-2fd3-4515-a50b-7336a332d47f", + "name": "Permission Sets", + "publisher": "Microsoft", + "version": "29.0.0.0" } ], "screenshots": [], diff --git a/src/System Application/App/Table Information/src/TableInformation.Page.al b/src/System Application/App/Table Information/src/TableInformation.Page.al index 63e68da0bb..f7620059ab 100644 --- a/src/System Application/App/Table Information/src/TableInformation.Page.al +++ b/src/System Application/App/Table Information/src/TableInformation.Page.al @@ -8,6 +8,7 @@ namespace System.DataAdministration; using System.Diagnostics; using System.Environment; using System.Reflection; +using System.Security.AccessControl; using System.Security.User; /// @@ -113,6 +114,28 @@ page 8700 "Table Information" } } + actions + { + area(Navigation) + { + action("View Table Permissions") + { + ApplicationArea = All; + Caption = 'View Table Permissions'; + Image = Permission; + Scope = Repeater; + ToolTip = 'View an overview of permissions that apply to this table across all permission sets.'; + + trigger OnAction() + var + PermissionsOverviewCU: Codeunit "Permissions Overview"; + begin + PermissionsOverviewCU.OpenForTable(Rec."Table No."); + end; + } + } + } + trigger OnInit() var UserPermissions: Codeunit "User Permissions";