@flusys/ng-iam 1.1.1-beta → 3.0.0-rc

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 +175 -24
  2. package/fesm2022/flusys-ng-iam-action-form-page.component-CVN8sV-c.mjs +389 -0
  3. package/fesm2022/flusys-ng-iam-action-form-page.component-CVN8sV-c.mjs.map +1 -0
  4. package/fesm2022/flusys-ng-iam-action-list-page.component-CQ6RazN0.mjs +262 -0
  5. package/fesm2022/flusys-ng-iam-action-list-page.component-CQ6RazN0.mjs.map +1 -0
  6. package/fesm2022/{flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs → flusys-ng-iam-flusys-ng-iam-DrGHlTiz.mjs} +1016 -1585
  7. package/fesm2022/flusys-ng-iam-flusys-ng-iam-DrGHlTiz.mjs.map +1 -0
  8. package/fesm2022/flusys-ng-iam-iam-container.component-BToYxEej.mjs +92 -0
  9. package/fesm2022/flusys-ng-iam-iam-container.component-BToYxEej.mjs.map +1 -0
  10. package/fesm2022/flusys-ng-iam-permission-page.component-BS7xXmsn.mjs +137 -0
  11. package/fesm2022/flusys-ng-iam-permission-page.component-BS7xXmsn.mjs.map +1 -0
  12. package/fesm2022/{flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs → flusys-ng-iam-role-form-page.component-BjPwXkip.mjs} +106 -148
  13. package/fesm2022/flusys-ng-iam-role-form-page.component-BjPwXkip.mjs.map +1 -0
  14. package/fesm2022/flusys-ng-iam-role-list-page.component-Cz-jk-R_.mjs +299 -0
  15. package/fesm2022/flusys-ng-iam-role-list-page.component-Cz-jk-R_.mjs.map +1 -0
  16. package/fesm2022/flusys-ng-iam.mjs +1 -1
  17. package/package.json +5 -5
  18. package/types/flusys-ng-iam.d.ts +75 -454
  19. package/fesm2022/flusys-ng-iam-action-form-page.component-C1j10Qhw.mjs +0 -467
  20. package/fesm2022/flusys-ng-iam-action-form-page.component-C1j10Qhw.mjs.map +0 -1
  21. package/fesm2022/flusys-ng-iam-action-list-page.component-BCzSardO.mjs +0 -281
  22. package/fesm2022/flusys-ng-iam-action-list-page.component-BCzSardO.mjs.map +0 -1
  23. package/fesm2022/flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs.map +0 -1
  24. package/fesm2022/flusys-ng-iam-iam-container.component-BkhqmzLi.mjs +0 -97
  25. package/fesm2022/flusys-ng-iam-iam-container.component-BkhqmzLi.mjs.map +0 -1
  26. package/fesm2022/flusys-ng-iam-permission-page.component-BSQFPt_N.mjs +0 -143
  27. package/fesm2022/flusys-ng-iam-permission-page.component-BSQFPt_N.mjs.map +0 -1
  28. package/fesm2022/flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs.map +0 -1
  29. package/fesm2022/flusys-ng-iam-role-list-page.component-BObCxHiB.mjs +0 -266
  30. package/fesm2022/flusys-ng-iam-role-list-page.component-BObCxHiB.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>;
@@ -610,45 +290,14 @@ declare class MyPermissionsApiService {
610
290
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<MyPermissionsApiService>;
611
291
  }
612
292
 
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
293
  declare class PermissionStateService {
635
294
  private readonly permissionApi;
636
295
  private readonly permissionValidator;
637
296
  private readonly _permissions;
638
- readonly permissions: Signal<IMyPermissionsResponseDto | null>;
297
+ readonly permissions: _angular_core.Signal<IMyPermissionsResponseDto | null>;
639
298
  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
- */
299
+ readonly isLoading: _angular_core.Signal<boolean>;
646
300
  loadPermissions(dto?: IGetMyPermissionsDto): Observable<void>;
647
- /**
648
- * Check if permissions are loaded
649
- *
650
- * @returns true if permissions are loaded
651
- */
652
301
  isLoaded(): boolean;
653
302
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PermissionStateService, never>;
654
303
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<PermissionStateService>;
@@ -670,19 +319,20 @@ declare class LogicBuilderComponent {
670
319
  name: string;
671
320
  }[]>;
672
321
  readonly logicChange: _angular_core.OutputEmitterRef<ILogicNode | null>;
673
- readonly availableActions: _angular_core.Signal<{
674
- id: string;
675
- name: string;
676
- }[]>;
677
- private builderTree;
322
+ /** Internal builder tree state (private writable + public readonly pattern) */
323
+ private readonly _builderTree;
678
324
  readonly builderLogic: _angular_core.Signal<IBuilderNode | null>;
325
+ constructor();
679
326
  initializeLogic(): void;
680
327
  clearLogic(): void;
681
328
  toggleOperator(nodeId: string): void;
682
329
  addChildNode(parentId: string, type: 'group' | 'action'): void;
683
330
  removeNode(nodeId: string): void;
684
331
  updateActionId(nodeId: string, actionId: string): void;
685
- private emitChange;
332
+ /** Updates a node in the tree and emits the change */
333
+ private updateNode;
334
+ /** Sets the tree and emits the change */
335
+ private updateTreeAndEmit;
686
336
  private updateNodeInTree;
687
337
  private removeNodeFromTree;
688
338
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<LogicBuilderComponent, never>;
@@ -723,7 +373,12 @@ declare class LogicBuilderComponent {
723
373
  * <flusys-role-action-selector />
724
374
  * ```
725
375
  */
726
- declare class RoleActionSelectorComponent implements OnDestroy {
376
+ declare class RoleActionSelectorComponent {
377
+ readonly ROLE_ACTION_PERMISSIONS: {
378
+ readonly READ: "role-action.read";
379
+ readonly ASSIGN: "role-action.assign";
380
+ };
381
+ private readonly destroyRef;
727
382
  private readonly roleApi;
728
383
  private readonly actionApi;
729
384
  private readonly permissionApi;
@@ -751,7 +406,6 @@ declare class RoleActionSelectorComponent implements OnDestroy {
751
406
  readonly canSave: _angular_core.Signal<boolean>;
752
407
  private loadDataAbortController;
753
408
  constructor();
754
- ngOnDestroy(): void;
755
409
  /**
756
410
  * Load roles from API
757
411
  */
@@ -772,25 +426,16 @@ declare class RoleActionSelectorComponent implements OnDestroy {
772
426
  * Handle action toggle with dependency management
773
427
  */
774
428
  onActionToggle(action: IAction, newValue: boolean): void;
775
- /**
776
- * Toggle all actions
777
- */
778
429
  toggleAll(): void;
779
- /**
780
- * Select all actions
781
- */
782
430
  selectAll(): void;
783
- /**
784
- * Deselect all actions
785
- */
786
431
  deselectAll(): void;
432
+ private setAllSelection;
787
433
  /**
788
434
  * Save changes to backend
789
435
  */
790
436
  saveChanges(): Promise<void>;
791
- /**
792
- * Reset component state
793
- */
437
+ private applySelection;
438
+ private buildPayloadItems;
794
439
  private resetState;
795
440
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RoleActionSelectorComponent, never>;
796
441
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<RoleActionSelectorComponent, "flusys-role-action-selector", never, {}, {}, never, never, true, never>;
@@ -830,13 +475,18 @@ declare class RoleActionSelectorComponent implements OnDestroy {
830
475
  * <flusys-company-action-selector />
831
476
  * ```
832
477
  */
833
- declare class CompanyActionSelectorComponent implements OnDestroy {
478
+ declare class CompanyActionSelectorComponent {
479
+ readonly COMPANY_ACTION_PERMISSIONS: {
480
+ readonly READ: "company-action.read";
481
+ readonly ASSIGN: "company-action.assign";
482
+ };
834
483
  private readonly companyApiProvider;
835
484
  private readonly actionApi;
836
485
  private readonly permissionApi;
837
486
  private readonly messageService;
838
487
  private readonly confirmationService;
839
488
  private readonly permissionLogic;
489
+ private readonly destroyRef;
840
490
  readonly selectedCompanyId: _angular_core.WritableSignal<string | undefined>;
841
491
  readonly companies: _angular_core.WritableSignal<ICompany[]>;
842
492
  readonly loading: _angular_core.WritableSignal<boolean>;
@@ -859,7 +509,6 @@ declare class CompanyActionSelectorComponent implements OnDestroy {
859
509
  readonly canSave: _angular_core.Signal<boolean>;
860
510
  private loadDataAbortController;
861
511
  constructor();
862
- ngOnDestroy(): void;
863
512
  /**
864
513
  * Load companies from API
865
514
  */
@@ -880,18 +529,10 @@ declare class CompanyActionSelectorComponent implements OnDestroy {
880
529
  * Handle action checkbox toggle
881
530
  */
882
531
  onActionToggle(action: IAction, newValue: boolean): void;
883
- /**
884
- * Toggle all actions
885
- */
886
532
  toggleAll(): void;
887
- /**
888
- * Select all actions
889
- */
890
533
  selectAll(): void;
891
- /**
892
- * Deselect all actions
893
- */
894
534
  deselectAll(): void;
535
+ private setAllSelection;
895
536
  /**
896
537
  * Save changes to backend
897
538
  */
@@ -901,10 +542,9 @@ declare class CompanyActionSelectorComponent implements OnDestroy {
901
542
  * Shows confirmation dialog with auto-fix option
902
543
  */
903
544
  private handleBackendPrerequisiteErrors;
904
- /**
905
- * Reset component state
906
- */
907
545
  private resetState;
546
+ private buildSelectionMap;
547
+ private buildPayloadItems;
908
548
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CompanyActionSelectorComponent, never>;
909
549
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<CompanyActionSelectorComponent, "flusys-company-action-selector", never, {}, {}, never, never, true, never>;
910
550
  }
@@ -940,6 +580,10 @@ declare class CompanyActionSelectorComponent implements OnDestroy {
940
580
  * ```
941
581
  */
942
582
  declare class UserRoleSelectorComponent {
583
+ readonly USER_ROLE_PERMISSIONS: {
584
+ readonly READ: "user-role.read";
585
+ readonly ASSIGN: "user-role.assign";
586
+ };
943
587
  private readonly appConfig;
944
588
  private readonly companyContext;
945
589
  private readonly userPermissionProvider;
@@ -993,6 +637,10 @@ declare class UserRoleSelectorComponent {
993
637
  * Deselect all roles
994
638
  */
995
639
  deselectAll(): void;
640
+ /**
641
+ * Set all role selections to a given value
642
+ */
643
+ private setAllSelections;
996
644
  /**
997
645
  * Save changes to backend
998
646
  */
@@ -1037,6 +685,10 @@ declare class UserRoleSelectorComponent {
1037
685
  * ```
1038
686
  */
1039
687
  declare class UserActionSelectorComponent {
688
+ readonly USER_ACTION_PERMISSIONS: {
689
+ readonly READ: "user-action.read";
690
+ readonly ASSIGN: "user-action.assign";
691
+ };
1040
692
  private readonly appConfig;
1041
693
  private readonly companyContext;
1042
694
  private readonly userPermissionProvider;
@@ -1057,6 +709,7 @@ declare class UserActionSelectorComponent {
1057
709
  readonly selectionMap: _angular_core.Signal<Record<string, boolean>>;
1058
710
  private readonly _initialSelection;
1059
711
  private readonly initialSelection;
712
+ private readonly isCompanyFeatureActive;
1060
713
  readonly showBranchSelector: _angular_core.Signal<boolean>;
1061
714
  readonly filteredBranches: _angular_core.Signal<IBranch[]>;
1062
715
  readonly treeNodes: _angular_core.Signal<primeng_api.TreeNode<IAction>[]>;
@@ -1085,29 +738,17 @@ declare class UserActionSelectorComponent {
1085
738
  */
1086
739
  hasUnmetPrerequisites(action: IAction): boolean;
1087
740
  /**
1088
- * Handle action checkbox toggle
741
+ * Handle action toggle with dependency management
1089
742
  */
1090
743
  onActionToggle(action: IAction, newValue: boolean): void;
1091
- /**
1092
- * Toggle all actions
1093
- */
1094
744
  toggleAll(): void;
1095
- /**
1096
- * Select all actions
1097
- */
1098
745
  selectAll(): void;
1099
- /**
1100
- * Deselect all actions
1101
- */
1102
746
  deselectAll(): void;
1103
- /**
1104
- * Save changes to backend
1105
- */
747
+ private setAllActions;
1106
748
  saveChanges(): Promise<void>;
1107
- /**
1108
- * Reset component state
1109
- */
1110
749
  private resetState;
750
+ private buildSelectionMap;
751
+ private buildPermissionItems;
1111
752
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserActionSelectorComponent, never>;
1112
753
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserActionSelectorComponent, "flusys-user-action-selector", never, {}, {}, never, never, true, never>;
1113
754
  }
@@ -1136,38 +777,18 @@ declare class ProfilePermissionProviderAdapter implements IProfilePermissionProv
1136
777
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ProfilePermissionProviderAdapter>;
1137
778
  }
1138
779
 
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
- */
780
+ /** Registers IAM provider adapters for ng-shared interfaces */
1158
781
  declare function provideIamProviders(): Provider[];
1159
782
 
1160
783
  /**
1161
784
  * IAM Routes Configuration
1162
785
  *
1163
- * Identity and Access Management routing
1164
- * - Actions: Permission actions (always visible)
786
+ * Identity and Access Management routing with permission guards.
787
+ * - Actions: Permission actions management
1165
788
  * - 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.
789
+ * - Permissions: User permission assignments
1169
790
  */
1170
791
  declare const IAM_ROUTES: Routes;
1171
792
 
1172
793
  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 };
794
+ 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 };