@acorex-platform/module-security-management-client 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/acorex-platform-module-security-management-client-contracts.mjs +1854 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-terminate-session.command-CKq-4Z4O.mjs +107 -0
- package/fesm2022/acorex-platform-module-security-management-client-terminate-session.command-CKq-4Z4O.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client.mjs +1705 -0
- package/fesm2022/acorex-platform-module-security-management-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-security-management-client-contracts.d.ts +228 -0
- package/types/acorex-platform-module-security-management-client.d.ts +271 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as i1 from '@acorex-platform/framework-client/layout/widget-core';
|
|
3
|
+
import { AXPValueWidgetComponent, AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
|
|
4
|
+
import { AXBasePageComponent } from '@acorex/components/page';
|
|
5
|
+
import { AXPPermissionGroupDefinition, AXPPermissionDefinition } from '@acorex-platform/framework-client/auth';
|
|
6
|
+
import { AXValueChangedEvent } from '@acorex/cdk/common';
|
|
7
|
+
import { AXPCommand } from '@acorex-platform/framework-shared/runtime';
|
|
8
|
+
import { AXPExecuteCommandResult } from '@acorex-platform/framework-shared/core';
|
|
9
|
+
import { AXPWidgetConfig } from '@acorex-platform/framework-shared/widget-core';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Terminates device sessions for the current or specified session.
|
|
13
|
+
* Implementations are provided by connectivity layers (e.g. mock or API).
|
|
14
|
+
*/
|
|
15
|
+
declare abstract class AXMDeviceSessionsService {
|
|
16
|
+
abstract terminate(id: string): Promise<boolean>;
|
|
17
|
+
abstract terminateAllCurrentUserSessions(): Promise<boolean>;
|
|
18
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXMDeviceSessionsService, never>;
|
|
19
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXMDeviceSessionsService>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare class AXMPermissionsModule {
|
|
23
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXMPermissionsModule, never>;
|
|
24
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXMPermissionsModule, never, [typeof i1.AXPWidgetCoreModule], never>;
|
|
25
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXMPermissionsModule>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class AXMSecurityManagementModule {
|
|
29
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXMSecurityManagementModule, never>;
|
|
30
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXMSecurityManagementModule, never, [typeof AXMPermissionsModule], never>;
|
|
31
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXMSecurityManagementModule>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface MappedPermission extends Omit<AXPPermissionDefinition, 'children'> {
|
|
35
|
+
isSelected: boolean;
|
|
36
|
+
children: MappedPermission[] | null;
|
|
37
|
+
}
|
|
38
|
+
interface PermissionSearchGroupResult {
|
|
39
|
+
group: AXPPermissionGroupDefinition & {
|
|
40
|
+
badge: string;
|
|
41
|
+
};
|
|
42
|
+
items: MappedPermission[];
|
|
43
|
+
}
|
|
44
|
+
declare class AXPPermissionsEditorComponent extends AXBasePageComponent {
|
|
45
|
+
/** Service for fetching permission groups and definitions */
|
|
46
|
+
private permissionService;
|
|
47
|
+
/** Session service for checking module access */
|
|
48
|
+
private sessionService;
|
|
49
|
+
/** Translation service for resolving permission labels during search */
|
|
50
|
+
private translationService;
|
|
51
|
+
/** Currently selected permission group */
|
|
52
|
+
protected selectedGroup: _angular_core.WritableSignal<AXPPermissionGroupDefinition | null>;
|
|
53
|
+
/** Current search query */
|
|
54
|
+
protected searchQuery: _angular_core.WritableSignal<string>;
|
|
55
|
+
/** All available permission groups */
|
|
56
|
+
protected groups: _angular_core.WritableSignal<AXPPermissionGroupDefinition[]>;
|
|
57
|
+
/** Initial permissions to be selected - exposed as signal input */
|
|
58
|
+
initialPermissions: _angular_core.InputSignal<string[]>;
|
|
59
|
+
/** Whether the editor is in read-only mode */
|
|
60
|
+
readOnly: _angular_core.InputSignal<boolean>;
|
|
61
|
+
/** Whether popup footer actions (Cancel / Select) are shown */
|
|
62
|
+
showActions: _angular_core.InputSignal<boolean>;
|
|
63
|
+
/** List of selected permission names */
|
|
64
|
+
protected selectedPermissions: _angular_core.WritableSignal<string[]>;
|
|
65
|
+
/** Event emitted when permissions selection changes */
|
|
66
|
+
permissionsChanged: _angular_core.OutputEmitterRef<string[]>;
|
|
67
|
+
/** Event emitted when permissions are applied/selected */
|
|
68
|
+
permissionsSelected: _angular_core.OutputEmitterRef<string[]>;
|
|
69
|
+
/** Whether permission groups are being loaded */
|
|
70
|
+
protected isEditorLoading: _angular_core.WritableSignal<boolean>;
|
|
71
|
+
constructor();
|
|
72
|
+
/**
|
|
73
|
+
* Reads a signal input or a plain value assigned by AXPopupService data binding.
|
|
74
|
+
*/
|
|
75
|
+
private readBoundValue;
|
|
76
|
+
/** Whether popup footer actions are visible (supports popup data and input binding). */
|
|
77
|
+
protected isShowActions(): boolean;
|
|
78
|
+
/** Whether the editor is read-only (supports popup data and input binding). */
|
|
79
|
+
protected isReadOnlyMode(): boolean;
|
|
80
|
+
/** Initial permission selection (supports popup data and input binding). */
|
|
81
|
+
protected getInitialPermissions(): string[];
|
|
82
|
+
/**
|
|
83
|
+
* Recursively maps permissions to include selection state and children.
|
|
84
|
+
*/
|
|
85
|
+
private mapPermissions;
|
|
86
|
+
/**
|
|
87
|
+
* Computed: Returns mapped permissions for the selected group.
|
|
88
|
+
*/
|
|
89
|
+
protected items: _angular_core.Signal<MappedPermission[]>;
|
|
90
|
+
/**
|
|
91
|
+
* Computed: Returns groups with badge counts, sorted by title.
|
|
92
|
+
*/
|
|
93
|
+
protected groupsWithBadge: _angular_core.Signal<{
|
|
94
|
+
badge: string;
|
|
95
|
+
name: string;
|
|
96
|
+
title: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
permissions: AXPPermissionDefinition[];
|
|
99
|
+
}[]>;
|
|
100
|
+
/** Sidebar group placeholders for the loading skeleton */
|
|
101
|
+
protected readonly groupSkeletonPlaceholders: _angular_core.Signal<string[]>;
|
|
102
|
+
/** Permission group placeholders (parent + child rows) for the loading skeleton */
|
|
103
|
+
protected readonly permissionGroupSkeletonPlaceholders: _angular_core.Signal<{
|
|
104
|
+
childCount: number;
|
|
105
|
+
}[]>;
|
|
106
|
+
/** Child row placeholders for a permission group skeleton */
|
|
107
|
+
protected readonly childSkeletonPlaceholders: (count: number) => number[];
|
|
108
|
+
/** Whether the user is actively searching permissions */
|
|
109
|
+
protected isSearchActive: _angular_core.Signal<boolean>;
|
|
110
|
+
/** Grouped search results across all permission groups */
|
|
111
|
+
protected searchResultsGrouped: _angular_core.Signal<PermissionSearchGroupResult[]>;
|
|
112
|
+
/** Whether the active search returned any permission groups */
|
|
113
|
+
protected hasSearchResults: _angular_core.Signal<boolean>;
|
|
114
|
+
/**
|
|
115
|
+
* Extracts module name from a permission group name.
|
|
116
|
+
* Handles multiple formats:
|
|
117
|
+
* - Permission key format: 'SecurityManagement:Permission:SecurityManagement.Management' -> 'SecurityManagement'
|
|
118
|
+
* - PascalCase: 'TenantManagement' -> 'TenantManagement'
|
|
119
|
+
* - kebab-case: 'tenant-management' -> 'TenantManagement' (converts to PascalCase)
|
|
120
|
+
*/
|
|
121
|
+
private extractModuleNameFromGroupName;
|
|
122
|
+
/**
|
|
123
|
+
* Filters permission groups to only include those from enabled modules.
|
|
124
|
+
*/
|
|
125
|
+
private filterGroupsByEnabledModules;
|
|
126
|
+
/**
|
|
127
|
+
* Recursively collects all permission names (parents and children) from an array.
|
|
128
|
+
*/
|
|
129
|
+
private collectAllPermissionNames;
|
|
130
|
+
/**
|
|
131
|
+
* Returns the badge count for a group (all selected permissions, including parents).
|
|
132
|
+
*/
|
|
133
|
+
private getBadge;
|
|
134
|
+
/**
|
|
135
|
+
* Checks if a permission is selected.
|
|
136
|
+
*/
|
|
137
|
+
private isSelected;
|
|
138
|
+
/**
|
|
139
|
+
* Checks if a permission is selected.
|
|
140
|
+
*/
|
|
141
|
+
protected badgeToNumber(value: unknown): number;
|
|
142
|
+
/**
|
|
143
|
+
* Returns true when searchable text contains the query.
|
|
144
|
+
*/
|
|
145
|
+
private matchesSearchText;
|
|
146
|
+
/**
|
|
147
|
+
* Returns true when a permission title or description matches the query.
|
|
148
|
+
*/
|
|
149
|
+
private matchesPermission;
|
|
150
|
+
/**
|
|
151
|
+
* Returns true when a permission group title or description matches the query.
|
|
152
|
+
*/
|
|
153
|
+
private matchesGroup;
|
|
154
|
+
/**
|
|
155
|
+
* Filters permissions while keeping ancestor nodes for matching descendants.
|
|
156
|
+
*/
|
|
157
|
+
private filterPermissions;
|
|
158
|
+
/**
|
|
159
|
+
* Returns filtered permissions for a group, or all permissions when the group itself matches.
|
|
160
|
+
*/
|
|
161
|
+
private getFilteredGroupPermissions;
|
|
162
|
+
/**
|
|
163
|
+
* Recursively collects all descendant permission names for a single item (including itself).
|
|
164
|
+
*/
|
|
165
|
+
private collectPermissionNames;
|
|
166
|
+
/**
|
|
167
|
+
* Gets the current selected permissions.
|
|
168
|
+
*/
|
|
169
|
+
getSelectedPermissions(): string[];
|
|
170
|
+
/**
|
|
171
|
+
* Sets the selected permissions.
|
|
172
|
+
*/
|
|
173
|
+
setSelectedPermissions(permissions: string[]): void;
|
|
174
|
+
/**
|
|
175
|
+
* Applies/selects the current permissions.
|
|
176
|
+
*/
|
|
177
|
+
selectPermissions(): void;
|
|
178
|
+
/**
|
|
179
|
+
* Initializes the component and loads permission groups.
|
|
180
|
+
* Filters groups to only show permissions from modules enabled for the current tenant.
|
|
181
|
+
*/
|
|
182
|
+
ngOnInit(): Promise<void>;
|
|
183
|
+
/**
|
|
184
|
+
* Handles group tab/menu item click.
|
|
185
|
+
*/
|
|
186
|
+
protected handleMenuItemClick(item: AXPPermissionGroupDefinition): void;
|
|
187
|
+
/**
|
|
188
|
+
* Updates the search query when the search box value changes.
|
|
189
|
+
*/
|
|
190
|
+
protected handleSearchChanged(event: AXValueChangedEvent<string | null>): void;
|
|
191
|
+
/**
|
|
192
|
+
* Handles permission checkbox toggle (checks/unchecks all children recursively).
|
|
193
|
+
*/
|
|
194
|
+
protected onPermissionToggle(item: MappedPermission, e: AXValueChangedEvent): void;
|
|
195
|
+
/**
|
|
196
|
+
* Closes the popup without applying permission changes.
|
|
197
|
+
*/
|
|
198
|
+
protected handleCancelClick(): void;
|
|
199
|
+
/**
|
|
200
|
+
* Applies the current selection and closes the popup.
|
|
201
|
+
*/
|
|
202
|
+
protected handleSelectClick(): void;
|
|
203
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPPermissionsEditorComponent, never>;
|
|
204
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXPPermissionsEditorComponent, "axm-permissions-editor", never, { "initialPermissions": { "alias": "initialPermissions"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "showActions": { "alias": "showActions"; "required": false; "isSignal": true; }; }, { "permissionsChanged": "permissionsChanged"; "permissionsSelected": "permissionsSelected"; }, never, never, true, never>;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
interface AXMAssignPermissionsCommandInput {
|
|
208
|
+
__context__?: {
|
|
209
|
+
data?: Record<string, unknown>;
|
|
210
|
+
entity?: string;
|
|
211
|
+
entityInfo?: {
|
|
212
|
+
name?: string;
|
|
213
|
+
module?: string;
|
|
214
|
+
title?: string;
|
|
215
|
+
parentKey?: string;
|
|
216
|
+
source?: string;
|
|
217
|
+
};
|
|
218
|
+
options?: unknown;
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
declare class AXMAssignPermissionsCommand implements AXPCommand<AXMAssignPermissionsCommandInput, string[] | null> {
|
|
222
|
+
private readonly popupService;
|
|
223
|
+
private readonly translationService;
|
|
224
|
+
private readonly entityRegistry;
|
|
225
|
+
private readonly toastService;
|
|
226
|
+
private readonly settingsService;
|
|
227
|
+
private readonly workflowEventService;
|
|
228
|
+
execute(input: AXMAssignPermissionsCommandInput): Promise<AXPExecuteCommandResult<string[] | null>>;
|
|
229
|
+
private resolveRoleTitle;
|
|
230
|
+
private showSuccessToast;
|
|
231
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXMAssignPermissionsCommand, never>;
|
|
232
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXMAssignPermissionsCommand>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
interface PermissionPath {
|
|
236
|
+
group: AXPPermissionGroupDefinition;
|
|
237
|
+
path: AXPPermissionDefinition[];
|
|
238
|
+
displayPath: string;
|
|
239
|
+
}
|
|
240
|
+
declare class AXPPermissionsWidgetViewComponent extends AXPValueWidgetComponent<string[]> {
|
|
241
|
+
private permissionService;
|
|
242
|
+
private readonly commandService;
|
|
243
|
+
protected groups: _angular_core.WritableSignal<AXPPermissionGroupDefinition[]>;
|
|
244
|
+
private loadGroupsEffect;
|
|
245
|
+
protected selectedPermissionsByGroup: _angular_core.Signal<Record<string, PermissionPath[]>>;
|
|
246
|
+
protected isEmpty: _angular_core.Signal<boolean>;
|
|
247
|
+
protected openPermissionsEditor(): Promise<void>;
|
|
248
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPPermissionsWidgetViewComponent, never>;
|
|
249
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXPPermissionsWidgetViewComponent, "axm-permissions-widget-view", never, {}, {}, never, never, true, never>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
declare class AXPPermissionsWidgetEditComponent extends AXPValueWidgetComponent<string[]> {
|
|
253
|
+
/**
|
|
254
|
+
* Handles permissions changes from the editor.
|
|
255
|
+
*/
|
|
256
|
+
protected onPermissionsChanged(permissions: string[]): void;
|
|
257
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPPermissionsWidgetEditComponent, never>;
|
|
258
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXPPermissionsWidgetEditComponent, "axm-permissions-widget-edit", never, {}, {}, never, never, true, never>;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
declare class AXPPermissionsWidgetColumnComponent extends AXPColumnWidgetComponent<any> {
|
|
262
|
+
protected count: _angular_core.Signal<number>;
|
|
263
|
+
private readonly commandService;
|
|
264
|
+
openPermissionsEditor(): Promise<void>;
|
|
265
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPPermissionsWidgetColumnComponent, never>;
|
|
266
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXPPermissionsWidgetColumnComponent, "axm-permissions-widget-column", never, { "rawValue": { "alias": "rawValue"; "required": false; }; "rowData": { "alias": "rowData"; "required": false; }; }, {}, never, never, true, never>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare const AXPPermissionsWidget: AXPWidgetConfig;
|
|
270
|
+
|
|
271
|
+
export { AXMAssignPermissionsCommand, AXMDeviceSessionsService, AXMPermissionsModule, AXMSecurityManagementModule, AXPPermissionsEditorComponent, AXPPermissionsWidget, AXPPermissionsWidgetColumnComponent, AXPPermissionsWidgetEditComponent, AXPPermissionsWidgetViewComponent };
|