@flusys/ng-iam 1.1.0-beta → 1.1.0

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.
Files changed (30) hide show
  1. package/README.md +177 -25
  2. package/fesm2022/flusys-ng-iam-action-form-page.component-eXpZNJ_H.mjs +389 -0
  3. package/fesm2022/flusys-ng-iam-action-form-page.component-eXpZNJ_H.mjs.map +1 -0
  4. package/fesm2022/flusys-ng-iam-action-list-page.component-BtJlGcTj.mjs +262 -0
  5. package/fesm2022/flusys-ng-iam-action-list-page.component-BtJlGcTj.mjs.map +1 -0
  6. package/fesm2022/{flusys-ng-iam-flusys-ng-iam-BjdM-Vgz.mjs → flusys-ng-iam-flusys-ng-iam-CJAQT60K.mjs} +1046 -1617
  7. package/fesm2022/flusys-ng-iam-flusys-ng-iam-CJAQT60K.mjs.map +1 -0
  8. package/fesm2022/flusys-ng-iam-iam-container.component-UYJjqYV9.mjs +92 -0
  9. package/fesm2022/flusys-ng-iam-iam-container.component-UYJjqYV9.mjs.map +1 -0
  10. package/fesm2022/flusys-ng-iam-permission-page.component-DcgT7L3_.mjs +137 -0
  11. package/fesm2022/flusys-ng-iam-permission-page.component-DcgT7L3_.mjs.map +1 -0
  12. package/fesm2022/{flusys-ng-iam-role-form-page.component-Ctigzpon.mjs → flusys-ng-iam-role-form-page.component-D_AAEay2.mjs} +109 -151
  13. package/fesm2022/flusys-ng-iam-role-form-page.component-D_AAEay2.mjs.map +1 -0
  14. package/fesm2022/flusys-ng-iam-role-list-page.component-D4J1by6Q.mjs +299 -0
  15. package/fesm2022/flusys-ng-iam-role-list-page.component-D4J1by6Q.mjs.map +1 -0
  16. package/fesm2022/flusys-ng-iam.mjs +1 -1
  17. package/package.json +10 -10
  18. package/types/flusys-ng-iam.d.ts +75 -455
  19. package/fesm2022/flusys-ng-iam-action-form-page.component-DBJzC5GS.mjs +0 -467
  20. package/fesm2022/flusys-ng-iam-action-form-page.component-DBJzC5GS.mjs.map +0 -1
  21. package/fesm2022/flusys-ng-iam-action-list-page.component-Dfts0JCt.mjs +0 -281
  22. package/fesm2022/flusys-ng-iam-action-list-page.component-Dfts0JCt.mjs.map +0 -1
  23. package/fesm2022/flusys-ng-iam-flusys-ng-iam-BjdM-Vgz.mjs.map +0 -1
  24. package/fesm2022/flusys-ng-iam-iam-container.component-Chl5MDkV.mjs +0 -97
  25. package/fesm2022/flusys-ng-iam-iam-container.component-Chl5MDkV.mjs.map +0 -1
  26. package/fesm2022/flusys-ng-iam-permission-page.component-cDrwUAQ_.mjs +0 -143
  27. package/fesm2022/flusys-ng-iam-permission-page.component-cDrwUAQ_.mjs.map +0 -1
  28. package/fesm2022/flusys-ng-iam-role-form-page.component-Ctigzpon.mjs.map +0 -1
  29. package/fesm2022/flusys-ng-iam-role-list-page.component-BF-Z_TQK.mjs +0 -266
  30. package/fesm2022/flusys-ng-iam-role-list-page.component-BF-Z_TQK.mjs.map +0 -1
@@ -1,8 +1,9 @@
1
1
  import { IBaseEntity, ILogicNode, ApiResourceService, ISingleResponse, IProfilePermissionProvider, IProfileRoleInfo, IProfileActionInfo } from '@flusys/ng-shared';
2
2
  import * as _angular_core from '@angular/core';
3
- import { Signal, OnDestroy, Provider } from '@angular/core';
3
+ import { Provider } from '@angular/core';
4
4
  import { Observable } from 'rxjs';
5
5
  import { BaseApiService } from '@flusys/ng-core';
6
+ export { PermissionMode } from '@flusys/ng-core';
6
7
  import * as primeng_api from 'primeng/api';
7
8
  import { Routes } from '@angular/router';
8
9
 
@@ -35,10 +36,6 @@ interface IBranch {
35
36
  companyId: string;
36
37
  }
37
38
 
38
- /**
39
- * Role Response DTO
40
- * Matches backend RoleResponseDto
41
- */
42
39
  interface IRole extends IBaseEntity {
43
40
  readOnly: boolean;
44
41
  name: string;
@@ -46,49 +43,30 @@ interface IRole extends IBaseEntity {
46
43
  companyId: string | null;
47
44
  isActive: boolean;
48
45
  serial: number | null;
49
- metadata: Record<string, any> | null;
46
+ metadata: Record<string, unknown> | null;
50
47
  }
51
- /**
52
- * Create Role DTO
53
- * Matches backend CreateRoleDto
54
- */
55
48
  interface ICreateRoleDto {
56
49
  name: string;
57
50
  description?: string;
58
51
  companyId?: string;
59
52
  isActive?: boolean;
60
53
  serial?: number;
61
- metadata?: Record<string, any>;
54
+ metadata?: Record<string, unknown>;
62
55
  }
63
- /**
64
- * Update Role DTO
65
- * Matches backend UpdateRoleDto
66
- */
67
56
  interface IUpdateRoleDto extends Partial<ICreateRoleDto> {
68
57
  id: string;
69
58
  }
70
- /**
71
- * Role Query DTO
72
- * Matches backend RoleQueryDto
73
- */
74
59
  interface IRoleQueryDto {
75
60
  companyId?: string;
76
61
  isActive?: boolean;
77
62
  }
78
63
 
79
- /**
80
- * Action Type - determines how action is used
81
- * CRITICAL: Must match backend ActionType enum exactly
82
- */
64
+ /** Must match backend ActionType enum */
83
65
  declare enum ActionType {
84
- BACKEND = "backend",// For API endpoint permissions (cached for PermissionGuard)
85
- FRONTEND = "frontend",// For frontend features (returned in my-permissions API)
66
+ BACKEND = "backend",
67
+ FRONTEND = "frontend",
86
68
  BOTH = "both"
87
69
  }
88
- /**
89
- * Action Response DTO
90
- * Matches backend ActionResponseDto
91
- */
92
70
  interface IAction extends IBaseEntity {
93
71
  readOnly: boolean;
94
72
  name: string;
@@ -99,19 +77,11 @@ interface IAction extends IBaseEntity {
99
77
  parentId: string | null;
100
78
  serial: number | null;
101
79
  isActive: boolean;
102
- metadata: Record<string, any> | null;
80
+ metadata: Record<string, unknown> | null;
103
81
  }
104
- /**
105
- * Action Tree DTO
106
- * Hierarchical action structure
107
- */
108
82
  interface IActionTreeDto extends IAction {
109
83
  children: IActionTreeDto[];
110
84
  }
111
- /**
112
- * Create Action DTO
113
- * Matches backend CreateActionDto
114
- */
115
85
  interface ICreateActionDto {
116
86
  name: string;
117
87
  description?: string;
@@ -121,82 +91,37 @@ interface ICreateActionDto {
121
91
  parentId?: string;
122
92
  serial?: number;
123
93
  isActive?: boolean;
124
- metadata?: Record<string, any>;
94
+ metadata?: Record<string, unknown>;
125
95
  }
126
- /**
127
- * Update Action DTO
128
- * Matches backend UpdateActionDto
129
- */
130
96
  interface IUpdateActionDto extends Partial<ICreateActionDto> {
131
97
  id: string;
132
98
  }
133
99
 
134
- /**
135
- * Permission Action - 'add' or 'remove'
136
- */
137
100
  type PermissionAction = 'add' | 'remove';
138
- /**
139
- * Permission Mode - matches backend IAMPermissionMode
140
- */
141
- type PermissionMode = 'rbac' | 'direct' | 'full';
142
- /**
143
- * Permission Item DTO
144
- * Used in all assignment operations
145
- */
146
101
  interface IPermissionItemDto {
147
102
  id: string;
148
103
  action: PermissionAction;
149
104
  }
150
- /**
151
- * Assign User Actions DTO
152
- * Assign/remove actions directly to/from user (DIRECT/FULL mode)
153
- *
154
- * Permission Granularity:
155
- * - companyId + branchId = undefined: Global (super admin)
156
- * - companyId set + branchId = undefined: Company-wide (all branches)
157
- * - companyId set + branchId set: Branch-specific
158
- */
159
105
  interface IAssignUserActionsDto {
160
106
  userId: string;
161
107
  companyId?: string;
162
108
  branchId?: string;
163
109
  items: IPermissionItemDto[];
164
110
  }
165
- /**
166
- * Assign Company Actions DTO
167
- * Whitelist actions for company (if company feature enabled)
168
- */
169
111
  interface IAssignCompanyActionsDto {
170
112
  companyId: string;
171
113
  items: IPermissionItemDto[];
172
114
  }
173
- /**
174
- * Assign Role Actions DTO
175
- * Assign/remove actions to/from role (RBAC/FULL mode)
176
- */
177
115
  interface IAssignRoleActionsDto {
178
116
  roleId: string;
179
117
  items: IPermissionItemDto[];
180
118
  }
181
- /**
182
- * Assign User Roles DTO
183
- * Assign/remove roles to/from user (RBAC/FULL mode)
184
- *
185
- * Permission Granularity:
186
- * - companyId + branchId = undefined: Global (super admin)
187
- * - companyId set + branchId = undefined: Company-wide (all branches)
188
- * - companyId set + branchId set: Branch-specific
189
- */
190
119
  interface IAssignUserRolesDto {
191
120
  userId: string;
192
121
  companyId?: string;
193
122
  branchId?: string;
194
123
  items: IPermissionItemDto[];
195
124
  }
196
- /**
197
- * User Action Response DTO
198
- * Direct user → action permissions (branch-scoped if company feature enabled)
199
- */
200
125
  interface IUserActionResponseDto {
201
126
  id: string;
202
127
  userId: string;
@@ -206,10 +131,6 @@ interface IUserActionResponseDto {
206
131
  branchId: string | null;
207
132
  createdAt: Date;
208
133
  }
209
- /**
210
- * Role Action Response DTO
211
- * Role → action permissions (NOT branch-scoped)
212
- */
213
134
  interface IRoleActionResponseDto {
214
135
  id: string;
215
136
  roleId: string;
@@ -218,10 +139,6 @@ interface IRoleActionResponseDto {
218
139
  actionName: string;
219
140
  createdAt: Date;
220
141
  }
221
- /**
222
- * Company Action Response DTO
223
- * Company → action whitelist
224
- */
225
142
  interface ICompanyActionResponseDto {
226
143
  id: string;
227
144
  companyId: string;
@@ -230,10 +147,6 @@ interface ICompanyActionResponseDto {
230
147
  actionName: string;
231
148
  createdAt: Date;
232
149
  }
233
- /**
234
- * User Role Response DTO
235
- * User → role assignments (NOT branch-scoped)
236
- */
237
150
  interface IUserRoleResponseDto {
238
151
  id: string;
239
152
  userId: string;
@@ -243,24 +156,6 @@ interface IUserRoleResponseDto {
243
156
  branchId: string | null;
244
157
  createdAt: Date;
245
158
  }
246
- /**
247
- * Menu item from IAM permissions (menu-type actions)
248
- */
249
- interface IMenuAction {
250
- id: string;
251
- code: string;
252
- name: string;
253
- route: string | null;
254
- icon: string | null;
255
- iconType: number | null;
256
- serial: number | null;
257
- parentId: string | null;
258
- children?: IMenuAction[];
259
- }
260
- /**
261
- * My Permissions Response DTO
262
- * Complete user permissions (frontend actions, cached endpoints, menus)
263
- */
264
159
  interface IMyPermissionsResponseDto {
265
160
  frontendActions: Array<{
266
161
  id: string;
@@ -270,29 +165,17 @@ interface IMyPermissionsResponseDto {
270
165
  }>;
271
166
  cachedEndpoints: number;
272
167
  }
273
- /**
274
- * Prerequisite Action DTO
275
- * Action required as a prerequisite
276
- */
277
168
  interface IPrerequisiteActionDto {
278
169
  actionId: string;
279
170
  actionCode: string;
280
171
  actionName: string;
281
172
  }
282
- /**
283
- * Prerequisite Validation Error
284
- * Describes an action that failed prerequisite validation
285
- */
286
173
  interface IPrerequisiteValidationError {
287
174
  actionId: string;
288
175
  actionCode: string;
289
176
  actionName: string;
290
177
  requiredActions: IPrerequisiteActionDto[];
291
178
  }
292
- /**
293
- * Permission Operation Result DTO
294
- * Result of assignment operations
295
- */
296
179
  interface IPermissionOperationResultDto {
297
180
  success: boolean;
298
181
  added: number;
@@ -300,218 +183,60 @@ interface IPermissionOperationResultDto {
300
183
  message: string;
301
184
  prerequisiteErrors?: IPrerequisiteValidationError[];
302
185
  }
303
- /**
304
- * Get User Actions DTO
305
- * Optional branchId filter
306
- */
307
186
  interface IGetUserActionsDto {
308
187
  branchId?: string;
309
188
  }
310
- /**
311
- * Get Role Actions DTO
312
- * No parameters
313
- */
314
189
  interface IGetRoleActionsDto {
315
190
  }
316
- /**
317
- * Get User Roles DTO
318
- * Optional branchId filter (ignored - roles are NOT branch-scoped)
319
- */
320
191
  interface IGetUserRolesDto {
321
192
  branchId?: string;
322
193
  }
323
- /**
324
- * Get My Permissions DTO
325
- * Optional parentCodes filter for frontend actions
326
- */
327
194
  interface IGetMyPermissionsDto {
328
195
  parentCodes?: string[];
329
196
  }
330
197
 
331
- /**
332
- * Pagination Constants
333
- *
334
- * Standard pagination limits for IAM components.
335
- * Prevents excessive data loading and potential DoS.
336
- */
337
- /**
338
- * Maximum items to fetch for dropdown lists
339
- * Used for: companies, roles, users, branches
340
- *
341
- * Security: Prevents memory exhaustion from loading excessive records
342
- */
198
+ /** Maximum items for dropdown lists (companies, roles, users, branches) */
343
199
  declare const MAX_DROPDOWN_ITEMS = 100;
344
200
 
345
- /**
346
- * Role API Service
347
- * Handles role CRUD operations
348
- * Endpoint: POST /iam/roles/*
349
- * Conditional: Only available in RBAC/FULL mode
350
- */
351
201
  declare class RoleApiService extends ApiResourceService<IUpdateRoleDto, IRole> {
352
202
  constructor();
353
203
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RoleApiService, never>;
354
204
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<RoleApiService>;
355
205
  }
356
206
 
357
- /**
358
- * Action API Service
359
- * Handles action CRUD operations
360
- * Endpoint: POST /iam/actions/*
361
- */
362
207
  declare class ActionApiService extends ApiResourceService<IUpdateActionDto, IAction> {
363
208
  private readonly appConfig;
364
209
  constructor();
365
- /**
366
- * Get actions for permission assignment
367
- * GET /iam/actions/tree-for-permission
368
- * Returns actions filtered by company whitelist if enabled
369
- */
210
+ /** Get actions filtered by company whitelist for permission assignment */
370
211
  getActionsForPermission(): Observable<ISingleResponse<IActionTreeDto[]>>;
371
- /**
372
- * Get actions in hierarchical tree structure
373
- * POST /iam/actions/tree
374
- * Returns all actions organized in parent-child tree
375
- *
376
- * @param search - Optional search term (name or code)
377
- * @param isActive - Optional filter by active status
378
- * @param withDeleted - Include deleted actions (default: false)
379
- * @returns Observable of action tree response
380
- */
212
+ /** Get actions in hierarchical tree structure */
381
213
  getTree(search?: string, isActive?: boolean, withDeleted?: boolean): Observable<ISingleResponse<IActionTreeDto[]>>;
382
214
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ActionApiService, never>;
383
215
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ActionApiService>;
384
216
  }
385
217
 
386
- /**
387
- * Action Permission Logic Service
388
- *
389
- * Shared service for handling smart dependency management across all action selectors:
390
- * - Company-Action Selector
391
- * - Role-Action Selector
392
- * - User-Action Selector
393
- *
394
- * **Core Features:**
395
- * - Smart auto-selection (AND/OR optimization)
396
- * - Dependency detection and management
397
- * - Alternative suggestion for OR logic
398
- * - Visual formatting of permission logic trees
399
- * - Prerequisite validation
400
- *
401
- * @example
402
- * constructor() {
403
- * this.permissionLogic = inject(ActionPermissionLogicService);
404
- * }
405
- *
406
- * onActionToggle(action: IAction, newValue: boolean) {
407
- * if (!newValue) {
408
- * this.permissionLogic.handleUncheck(
409
- * action,
410
- * this.selectionMap(),
411
- * this.actions(),
412
- * (newMap) => this.selectionMap.set(newMap)
413
- * );
414
- * } else {
415
- * this.permissionLogic.handleCheck(
416
- * action,
417
- * this.selectionMap(),
418
- * this.actions(),
419
- * (newMap) => this.selectionMap.set(newMap),
420
- * (previousState) => this.selectionMap.set(previousState)
421
- * );
422
- * }
423
- * }
424
- */
218
+ /** Shared service for smart dependency management across action selectors */
425
219
  declare class ActionPermissionLogicService {
426
220
  private readonly confirmationService;
427
221
  private readonly messageService;
428
- /**
429
- * Handle checking an action with prerequisite validation
430
- *
431
- * Uses recursive deep scan to find ALL missing prerequisites at all levels,
432
- * not just direct dependencies. This ensures cascading dependencies are
433
- * resolved in a single step.
434
- *
435
- * @param action - Action being checked
436
- * @param currentSelection - Current selection map
437
- * @param allActions - All available actions
438
- * @param onUpdate - Callback to update selection
439
- * @param onCancel - Callback when user cancels
440
- */
222
+ /** Handle checking an action with prerequisite validation (recursive deep scan) */
441
223
  handleCheck(action: IAction, currentSelection: Record<string, boolean>, allActions: IAction[], onUpdate: (newSelection: Record<string, boolean>) => void, onCancel: (previousState: Record<string, boolean>) => void): void;
442
- /**
443
- * Handle unchecking an action with dependency detection
444
- *
445
- * @param action - Action being unchecked
446
- * @param currentSelection - Current selection map
447
- * @param allActions - All available actions
448
- * @param onUpdate - Callback to update selection
449
- */
224
+ /** Handle unchecking an action with dependency detection */
450
225
  handleUncheck(action: IAction, currentSelection: Record<string, boolean>, allActions: IAction[], onUpdate: (newSelection: Record<string, boolean>) => void): void;
451
- /**
452
- * Check if an action has unmet prerequisites
453
- *
454
- * @param action - Action to check
455
- * @param currentSelection - Current selection map
456
- * @param allActions - All available actions
457
- * @returns True if action has unmet prerequisites
458
- */
226
+ /** Check if an action has unmet prerequisites */
459
227
  hasUnmetPrerequisites(action: IAction, currentSelection: Record<string, boolean>, allActions: IAction[]): boolean;
460
- /**
461
- * Get all selected actions that have unmet prerequisites
462
- *
463
- * @param currentSelection - Current selection map
464
- * @param allActions - All available actions
465
- * @returns Array of actions with unmet prerequisites
466
- */
228
+ /** Get all selected actions that have unmet prerequisites */
467
229
  getActionsWithUnmetPrerequisites(currentSelection: Record<string, boolean>, allActions: IAction[]): IAction[];
468
- /**
469
- * Show validation error dialog with auto-fix options
470
- *
471
- * @param invalidActions - Actions with unmet prerequisites
472
- * @param currentSelection - Current selection map
473
- * @param allActions - All available actions
474
- * @param onUpdate - Callback to update selection
475
- */
230
+ /** Show validation error dialog with auto-fix options */
476
231
  showValidationErrorDialog(invalidActions: IAction[], currentSelection: Record<string, boolean>, allActions: IAction[], onUpdate: (newSelection: Record<string, boolean>) => void): void;
477
- /**
478
- * Get prerequisite description for tooltip display
479
- *
480
- * @param action - Action to get prerequisites for
481
- * @param currentSelection - Current selection map
482
- * @param allActions - All available actions
483
- * @returns Plain text prerequisite description
484
- */
232
+ /** Get prerequisite description for tooltip display */
485
233
  getPrerequisiteTooltip(action: IAction, currentSelection: Record<string, boolean>, allActions: IAction[]): string;
486
- /**
487
- * Build dynamic logic tree message with AND/OR operators and nesting
488
- *
489
- * @param logic - Permission logic tree
490
- * @param missingActions - Actions that are missing
491
- * @param allActions - All available actions
492
- * @param currentSelection - Current selection map for accurate status
493
- * @returns HTML formatted logic tree
494
- */
495
- buildLogicMessage(logic: ILogicNode, missingActions: IAction[], allActions: IAction[], currentSelection?: Record<string, boolean>): string;
234
+ /** Build dynamic logic tree message with AND/OR operators and nesting */
235
+ buildLogicMessage(logic: ILogicNode, _missingActions: IAction[], allActions: IAction[], currentSelection?: Record<string, boolean>): string;
236
+ /** Extract selected action IDs from selection map */
237
+ private getSelectedIds;
496
238
  private sanitizeHtml;
497
- /**
498
- * Recursively collect ALL missing prerequisites at all dependency levels
499
- *
500
- * This prevents cascading prerequisite dialogs by finding the complete
501
- * dependency chain upfront.
502
- *
503
- * **Example:**
504
- * - Action 4 requires Action 3
505
- * - Action 3 requires Action 2
506
- * - Action 2 requires Action 1
507
- *
508
- * Instead of showing 3 separate dialogs, this returns: [Action 3, Action 2, Action 1]
509
- *
510
- * @param action - Starting action to check
511
- * @param currentSelection - Current selection map
512
- * @param allActions - All available actions
513
- * @returns Complete set of missing prerequisites across all levels
514
- */
239
+ /** Recursively collect ALL missing prerequisites at all dependency levels */
515
240
  private getAllMissingPrerequisitesRecursive;
516
241
  private showPrerequisiteDialog;
517
242
  private showDependencyDialog;
@@ -523,66 +248,21 @@ declare class ActionPermissionLogicService {
523
248
  private findRequiredActionIds;
524
249
  private buildSimpleMessage;
525
250
  private formatLogicNode;
526
- /**
527
- * Build clean text-based logic tree for tooltips
528
- */
251
+ /** Build clean text-based logic tree for tooltips */
529
252
  private buildTooltipLogicTree;
530
253
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ActionPermissionLogicService, never>;
531
254
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ActionPermissionLogicService>;
532
255
  }
533
256
 
534
- /**
535
- * Consolidated Permission API Service
536
- * Handles all permission-related operations in one service
537
- * Supports:
538
- * - User → Action (direct permissions)
539
- * - User → Role (role assignments)
540
- * - Role → Action (role permissions)
541
- * - Company → Action (company whitelisting)
542
- *
543
- * Endpoint: POST /permissions/*
544
- */
545
257
  declare class PermissionApiService extends BaseApiService {
546
258
  constructor();
547
- /**
548
- * Assign/remove actions directly to/from user
549
- * POST /permissions/user-actions/assign
550
- */
551
259
  assignUserActions(data: IAssignUserActionsDto): Observable<ISingleResponse<IPermissionOperationResultDto>>;
552
- /**
553
- * Get user's direct action permissions
554
- * GET /permissions/user-actions/:userId
555
- */
556
260
  getUserActions(userId: string, query?: IGetUserActionsDto): Observable<ISingleResponse<IUserActionResponseDto[]>>;
557
- /**
558
- * Assign/remove roles to/from user
559
- * POST /permissions/user-roles/assign
560
- */
561
261
  assignUserRoles(data: IAssignUserRolesDto): Observable<ISingleResponse<IPermissionOperationResultDto>>;
562
- /**
563
- * Get user's role assignments
564
- * GET /permissions/user-roles/:userId
565
- */
566
262
  getUserRoles(userId: string, query?: IGetUserRolesDto): Observable<ISingleResponse<IUserRoleResponseDto[]>>;
567
- /**
568
- * Assign/remove actions to/from role
569
- * POST /permissions/role-actions/assign
570
- */
571
263
  assignRoleActions(data: IAssignRoleActionsDto): Observable<ISingleResponse<IPermissionOperationResultDto>>;
572
- /**
573
- * Get role's action permissions
574
- * GET /permissions/role-actions/:roleId
575
- */
576
- getRoleActions(roleId: string, query?: IGetRoleActionsDto): Observable<ISingleResponse<IRoleActionResponseDto[]>>;
577
- /**
578
- * Assign/remove actions to/from company (whitelisting)
579
- * POST /permissions/company-actions/assign
580
- */
264
+ getRoleActions(roleId: string): Observable<ISingleResponse<IRoleActionResponseDto[]>>;
581
265
  assignCompanyActions(data: IAssignCompanyActionsDto): Observable<ISingleResponse<IPermissionOperationResultDto>>;
582
- /**
583
- * Get company's whitelisted actions
584
- * GET /permissions/company-actions/:companyId
585
- */
586
266
  getCompanyActions(companyId: string): Observable<ISingleResponse<ICompanyActionResponseDto[]>>;
587
267
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PermissionApiService, never>;
588
268
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<PermissionApiService>;
@@ -598,7 +278,6 @@ declare class MyPermissionsApiService {
598
278
  private readonly http;
599
279
  private readonly appConfig;
600
280
  private readonly baseUrl;
601
- constructor();
602
281
  /**
603
282
  * Get current user's complete permissions
604
283
  * POST /iam/permissions/my-permissions
@@ -610,45 +289,14 @@ declare class MyPermissionsApiService {
610
289
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<MyPermissionsApiService>;
611
290
  }
612
291
 
613
- /**
614
- * Permission State Service
615
- * Manages user permissions state and provides permission checking methods
616
- *
617
- * Uses shared PermissionValidatorService for centralized permission checking.
618
- *
619
- * @example
620
- * ```typescript
621
- * // In component
622
- * readonly permissionState = inject(PermissionStateService);
623
- *
624
- * ngOnInit() {
625
- * this.permissionState.loadPermissions();
626
- * }
627
- *
628
- * // Check permission
629
- * if (this.permissionState.hasAction('user.create')) {
630
- * // Show create button
631
- * }
632
- * ```
633
- */
634
292
  declare class PermissionStateService {
635
293
  private readonly permissionApi;
636
294
  private readonly permissionValidator;
637
295
  private readonly _permissions;
638
- readonly permissions: Signal<IMyPermissionsResponseDto | null>;
296
+ readonly permissions: _angular_core.Signal<IMyPermissionsResponseDto | null>;
639
297
  private readonly _isLoading;
640
- readonly isLoading: Signal<boolean>;
641
- /**
642
- * Load current user's permissions from API
643
- * Call this on app initialization or after login
644
- * Returns Observable for reactive composition
645
- */
298
+ readonly isLoading: _angular_core.Signal<boolean>;
646
299
  loadPermissions(dto?: IGetMyPermissionsDto): Observable<void>;
647
- /**
648
- * Check if permissions are loaded
649
- *
650
- * @returns true if permissions are loaded
651
- */
652
300
  isLoaded(): boolean;
653
301
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PermissionStateService, never>;
654
302
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<PermissionStateService>;
@@ -670,19 +318,20 @@ declare class LogicBuilderComponent {
670
318
  name: string;
671
319
  }[]>;
672
320
  readonly logicChange: _angular_core.OutputEmitterRef<ILogicNode | null>;
673
- readonly availableActions: _angular_core.Signal<{
674
- id: string;
675
- name: string;
676
- }[]>;
677
- private builderTree;
321
+ /** Internal builder tree state (private writable + public readonly pattern) */
322
+ private readonly _builderTree;
678
323
  readonly builderLogic: _angular_core.Signal<IBuilderNode | null>;
324
+ constructor();
679
325
  initializeLogic(): void;
680
326
  clearLogic(): void;
681
327
  toggleOperator(nodeId: string): void;
682
328
  addChildNode(parentId: string, type: 'group' | 'action'): void;
683
329
  removeNode(nodeId: string): void;
684
330
  updateActionId(nodeId: string, actionId: string): void;
685
- private emitChange;
331
+ /** Updates a node in the tree and emits the change */
332
+ private updateNode;
333
+ /** Sets the tree and emits the change */
334
+ private updateTreeAndEmit;
686
335
  private updateNodeInTree;
687
336
  private removeNodeFromTree;
688
337
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<LogicBuilderComponent, never>;
@@ -723,7 +372,12 @@ declare class LogicBuilderComponent {
723
372
  * <flusys-role-action-selector />
724
373
  * ```
725
374
  */
726
- declare class RoleActionSelectorComponent implements OnDestroy {
375
+ declare class RoleActionSelectorComponent {
376
+ readonly ROLE_ACTION_PERMISSIONS: {
377
+ readonly READ: "role-action.read";
378
+ readonly ASSIGN: "role-action.assign";
379
+ };
380
+ private readonly destroyRef;
727
381
  private readonly roleApi;
728
382
  private readonly actionApi;
729
383
  private readonly permissionApi;
@@ -751,7 +405,6 @@ declare class RoleActionSelectorComponent implements OnDestroy {
751
405
  readonly canSave: _angular_core.Signal<boolean>;
752
406
  private loadDataAbortController;
753
407
  constructor();
754
- ngOnDestroy(): void;
755
408
  /**
756
409
  * Load roles from API
757
410
  */
@@ -772,25 +425,16 @@ declare class RoleActionSelectorComponent implements OnDestroy {
772
425
  * Handle action toggle with dependency management
773
426
  */
774
427
  onActionToggle(action: IAction, newValue: boolean): void;
775
- /**
776
- * Toggle all actions
777
- */
778
428
  toggleAll(): void;
779
- /**
780
- * Select all actions
781
- */
782
429
  selectAll(): void;
783
- /**
784
- * Deselect all actions
785
- */
786
430
  deselectAll(): void;
431
+ private setAllSelection;
787
432
  /**
788
433
  * Save changes to backend
789
434
  */
790
435
  saveChanges(): Promise<void>;
791
- /**
792
- * Reset component state
793
- */
436
+ private applySelection;
437
+ private buildPayloadItems;
794
438
  private resetState;
795
439
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RoleActionSelectorComponent, never>;
796
440
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<RoleActionSelectorComponent, "flusys-role-action-selector", never, {}, {}, never, never, true, never>;
@@ -830,13 +474,18 @@ declare class RoleActionSelectorComponent implements OnDestroy {
830
474
  * <flusys-company-action-selector />
831
475
  * ```
832
476
  */
833
- declare class CompanyActionSelectorComponent implements OnDestroy {
477
+ declare class CompanyActionSelectorComponent {
478
+ readonly COMPANY_ACTION_PERMISSIONS: {
479
+ readonly READ: "company-action.read";
480
+ readonly ASSIGN: "company-action.assign";
481
+ };
834
482
  private readonly companyApiProvider;
835
483
  private readonly actionApi;
836
484
  private readonly permissionApi;
837
485
  private readonly messageService;
838
486
  private readonly confirmationService;
839
487
  private readonly permissionLogic;
488
+ private readonly destroyRef;
840
489
  readonly selectedCompanyId: _angular_core.WritableSignal<string | undefined>;
841
490
  readonly companies: _angular_core.WritableSignal<ICompany[]>;
842
491
  readonly loading: _angular_core.WritableSignal<boolean>;
@@ -859,7 +508,6 @@ declare class CompanyActionSelectorComponent implements OnDestroy {
859
508
  readonly canSave: _angular_core.Signal<boolean>;
860
509
  private loadDataAbortController;
861
510
  constructor();
862
- ngOnDestroy(): void;
863
511
  /**
864
512
  * Load companies from API
865
513
  */
@@ -880,18 +528,10 @@ declare class CompanyActionSelectorComponent implements OnDestroy {
880
528
  * Handle action checkbox toggle
881
529
  */
882
530
  onActionToggle(action: IAction, newValue: boolean): void;
883
- /**
884
- * Toggle all actions
885
- */
886
531
  toggleAll(): void;
887
- /**
888
- * Select all actions
889
- */
890
532
  selectAll(): void;
891
- /**
892
- * Deselect all actions
893
- */
894
533
  deselectAll(): void;
534
+ private setAllSelection;
895
535
  /**
896
536
  * Save changes to backend
897
537
  */
@@ -901,10 +541,9 @@ declare class CompanyActionSelectorComponent implements OnDestroy {
901
541
  * Shows confirmation dialog with auto-fix option
902
542
  */
903
543
  private handleBackendPrerequisiteErrors;
904
- /**
905
- * Reset component state
906
- */
907
544
  private resetState;
545
+ private buildSelectionMap;
546
+ private buildPayloadItems;
908
547
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CompanyActionSelectorComponent, never>;
909
548
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<CompanyActionSelectorComponent, "flusys-company-action-selector", never, {}, {}, never, never, true, never>;
910
549
  }
@@ -940,6 +579,10 @@ declare class CompanyActionSelectorComponent implements OnDestroy {
940
579
  * ```
941
580
  */
942
581
  declare class UserRoleSelectorComponent {
582
+ readonly USER_ROLE_PERMISSIONS: {
583
+ readonly READ: "user-role.read";
584
+ readonly ASSIGN: "user-role.assign";
585
+ };
943
586
  private readonly appConfig;
944
587
  private readonly companyContext;
945
588
  private readonly userPermissionProvider;
@@ -993,6 +636,10 @@ declare class UserRoleSelectorComponent {
993
636
  * Deselect all roles
994
637
  */
995
638
  deselectAll(): void;
639
+ /**
640
+ * Set all role selections to a given value
641
+ */
642
+ private setAllSelections;
996
643
  /**
997
644
  * Save changes to backend
998
645
  */
@@ -1037,6 +684,10 @@ declare class UserRoleSelectorComponent {
1037
684
  * ```
1038
685
  */
1039
686
  declare class UserActionSelectorComponent {
687
+ readonly USER_ACTION_PERMISSIONS: {
688
+ readonly READ: "user-action.read";
689
+ readonly ASSIGN: "user-action.assign";
690
+ };
1040
691
  private readonly appConfig;
1041
692
  private readonly companyContext;
1042
693
  private readonly userPermissionProvider;
@@ -1057,6 +708,7 @@ declare class UserActionSelectorComponent {
1057
708
  readonly selectionMap: _angular_core.Signal<Record<string, boolean>>;
1058
709
  private readonly _initialSelection;
1059
710
  private readonly initialSelection;
711
+ private readonly isCompanyFeatureActive;
1060
712
  readonly showBranchSelector: _angular_core.Signal<boolean>;
1061
713
  readonly filteredBranches: _angular_core.Signal<IBranch[]>;
1062
714
  readonly treeNodes: _angular_core.Signal<primeng_api.TreeNode<IAction>[]>;
@@ -1085,29 +737,17 @@ declare class UserActionSelectorComponent {
1085
737
  */
1086
738
  hasUnmetPrerequisites(action: IAction): boolean;
1087
739
  /**
1088
- * Handle action checkbox toggle
740
+ * Handle action toggle with dependency management
1089
741
  */
1090
742
  onActionToggle(action: IAction, newValue: boolean): void;
1091
- /**
1092
- * Toggle all actions
1093
- */
1094
743
  toggleAll(): void;
1095
- /**
1096
- * Select all actions
1097
- */
1098
744
  selectAll(): void;
1099
- /**
1100
- * Deselect all actions
1101
- */
1102
745
  deselectAll(): void;
1103
- /**
1104
- * Save changes to backend
1105
- */
746
+ private setAllActions;
1106
747
  saveChanges(): Promise<void>;
1107
- /**
1108
- * Reset component state
1109
- */
1110
748
  private resetState;
749
+ private buildSelectionMap;
750
+ private buildPermissionItems;
1111
751
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserActionSelectorComponent, never>;
1112
752
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserActionSelectorComponent, "flusys-user-action-selector", never, {}, {}, never, never, true, never>;
1113
753
  }
@@ -1136,38 +776,18 @@ declare class ProfilePermissionProviderAdapter implements IProfilePermissionProv
1136
776
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ProfilePermissionProviderAdapter>;
1137
777
  }
1138
778
 
1139
- /**
1140
- * Provide IAM Provider Adapters
1141
- *
1142
- * Registers IAM implementations for provider interfaces from ng-shared.
1143
- * This allows ng-auth profile page to display permissions without direct dependencies.
1144
- *
1145
- * @example
1146
- * // In app.config.ts
1147
- * import { provideIamProviders } from '@flusys/ng-iam';
1148
- *
1149
- * export const appConfig: ApplicationConfig = {
1150
- * providers: [
1151
- * ...provideIamProviders(),
1152
- * // ... other providers
1153
- * ]
1154
- * };
1155
- *
1156
- * @returns Array of Angular providers
1157
- */
779
+ /** Registers IAM provider adapters for ng-shared interfaces */
1158
780
  declare function provideIamProviders(): Provider[];
1159
781
 
1160
782
  /**
1161
783
  * IAM Routes Configuration
1162
784
  *
1163
- * Identity and Access Management routing
1164
- * - Actions: Permission actions (always visible)
785
+ * Identity and Access Management routing with permission guards.
786
+ * - Actions: Permission actions management
1165
787
  * - Roles: Role management (conditional on RBAC/FULL mode)
1166
- * - Permissions: User permission assignments (always visible)
1167
- *
1168
- * All routes are protected by permission guards to prevent direct URL access.
788
+ * - Permissions: User permission assignments
1169
789
  */
1170
790
  declare const IAM_ROUTES: Routes;
1171
791
 
1172
792
  export { ActionApiService, ActionPermissionLogicService, ActionType, CompanyActionSelectorComponent, IAM_ROUTES, LogicBuilderComponent, MAX_DROPDOWN_ITEMS, MyPermissionsApiService, PermissionApiService, PermissionStateService, ProfilePermissionProviderAdapter, RoleActionSelectorComponent, RoleApiService, UserActionSelectorComponent, UserRoleSelectorComponent, provideIamProviders };
1173
- export type { IAction, IActionTreeDto, IAssignCompanyActionsDto, IAssignRoleActionsDto, IAssignUserActionsDto, IAssignUserRolesDto, IBranch, ICompany, ICompanyActionResponseDto, ICreateActionDto, ICreateRoleDto, IGetMyPermissionsDto, IGetRoleActionsDto, IGetUserActionsDto, IGetUserRolesDto, IMenuAction, IMyPermissionsResponseDto, IPermissionItemDto, IPermissionOperationResultDto, IPrerequisiteActionDto, IPrerequisiteValidationError, IRole, IRoleActionResponseDto, IRoleQueryDto, IUpdateActionDto, IUpdateRoleDto, IUser, IUserActionResponseDto, IUserRoleResponseDto, PermissionAction, PermissionMode };
793
+ export type { IAction, IActionTreeDto, IAssignCompanyActionsDto, IAssignRoleActionsDto, IAssignUserActionsDto, IAssignUserRolesDto, IBranch, ICompany, ICompanyActionResponseDto, ICreateActionDto, ICreateRoleDto, IGetMyPermissionsDto, IGetRoleActionsDto, IGetUserActionsDto, IGetUserRolesDto, IMyPermissionsResponseDto, IPermissionItemDto, IPermissionOperationResultDto, IPrerequisiteActionDto, IPrerequisiteValidationError, IRole, IRoleActionResponseDto, IRoleQueryDto, IUpdateActionDto, IUpdateRoleDto, IUser, IUserActionResponseDto, IUserRoleResponseDto, PermissionAction };