@valtimo/access-control-management 13.35.0 → 13.36.1

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 (27) hide show
  1. package/fesm2022/valtimo-access-control-management.mjs +1558 -194
  2. package/fesm2022/valtimo-access-control-management.mjs.map +1 -1
  3. package/lib/access-control-management.module.d.ts +17 -11
  4. package/lib/components/access-control-form-editor-tab/access-control-form-editor-tab.component.d.ts +69 -0
  5. package/lib/components/condition-tree/condition-tree.component.d.ts +62 -0
  6. package/lib/components/editor/access-control-editor.component.d.ts +9 -3
  7. package/lib/components/overview/access-control-overview.component.d.ts +1 -0
  8. package/lib/components/permission-form/permission-form.component.d.ts +69 -0
  9. package/lib/components/role-metadata-modal/role-metadata-modal.component.d.ts +18 -5
  10. package/lib/constants/access-control-editor.test-ids.d.ts +19 -0
  11. package/lib/constants/access-control-labels.d.ts +3 -1
  12. package/lib/constants/index.d.ts +1 -0
  13. package/lib/models/access-control-editor-tab.model.d.ts +1 -0
  14. package/lib/models/index.d.ts +1 -0
  15. package/lib/models/pbac-editor.model.d.ts +10 -0
  16. package/lib/pipes/action-description.pipe.d.ts +10 -0
  17. package/lib/pipes/action-label.pipe.d.ts +10 -0
  18. package/lib/pipes/action-tag-type.pipe.d.ts +8 -0
  19. package/lib/pipes/index.d.ts +3 -0
  20. package/lib/services/access-control-form-editor.service.d.ts +37 -0
  21. package/lib/services/access-control.service.d.ts +4 -1
  22. package/lib/services/index.d.ts +1 -0
  23. package/lib/services/permission-schema-metadata.service.d.ts +19 -1
  24. package/lib/utils/condition-value.d.ts +17 -0
  25. package/lib/utils/index.d.ts +2 -0
  26. package/lib/utils/resource-name.d.ts +4 -0
  27. package/package.json +1 -1
@@ -2,18 +2,24 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "./components/overview/access-control-overview.component";
3
3
  import * as i2 from "./components/role-metadata-modal/role-metadata-modal.component";
4
4
  import * as i3 from "./components/editor/access-control-editor.component";
5
- import * as i4 from "./components/delete-role-modal/delete-role-modal.component";
6
- import * as i5 from "./components/export-role-modal/export-role-modal.component";
7
- import * as i6 from "@angular/common";
8
- import * as i7 from "./access-control-management-routing.module";
9
- import * as i8 from "carbon-components-angular";
10
- import * as i9 from "@angular/forms";
11
- import * as i10 from "@ngx-translate/core";
12
- import * as i11 from "@valtimo/components";
13
- import * as i12 from "./components/access-control-json-editor-tab/access-control-json-editor-tab.component";
14
- import * as i13 from "./components/access-control-overview-tab/access-control-overview-tab.component";
5
+ import * as i4 from "./components/access-control-form-editor-tab/access-control-form-editor-tab.component";
6
+ import * as i5 from "./components/condition-tree/condition-tree.component";
7
+ import * as i6 from "./components/delete-role-modal/delete-role-modal.component";
8
+ import * as i7 from "./components/export-role-modal/export-role-modal.component";
9
+ import * as i8 from "./components/permission-form/permission-form.component";
10
+ import * as i9 from "@angular/common";
11
+ import * as i10 from "./access-control-management-routing.module";
12
+ import * as i11 from "carbon-components-angular";
13
+ import * as i12 from "@angular/forms";
14
+ import * as i13 from "@ngx-translate/core";
15
+ import * as i14 from "@valtimo/components";
16
+ import * as i15 from "./components/access-control-json-editor-tab/access-control-json-editor-tab.component";
17
+ import * as i16 from "./components/access-control-overview-tab/access-control-overview-tab.component";
18
+ import * as i17 from "./pipes/action-label.pipe";
19
+ import * as i18 from "./pipes/action-description.pipe";
20
+ import * as i19 from "./pipes/action-tag-type.pipe";
15
21
  export declare class AccessControlManagementModule {
16
22
  static ɵfac: i0.ɵɵFactoryDeclaration<AccessControlManagementModule, never>;
17
- static ɵmod: i0.ɵɵNgModuleDeclaration<AccessControlManagementModule, [typeof i1.AccessControlOverviewComponent, typeof i2.RoleMetadataModalComponent, typeof i3.AccessControlEditorComponent, typeof i4.DeleteRoleModalComponent, typeof i5.ExportRoleModalComponent], [typeof i6.CommonModule, typeof i7.AccessControlManagementRoutingModule, typeof i8.ButtonModule, typeof i9.FormsModule, typeof i8.ModalModule, typeof i10.TranslateModule, typeof i9.ReactiveFormsModule, typeof i8.InputModule, typeof i8.IconModule, typeof i11.ConfirmationModalModule, typeof i11.RenderInPageHeaderDirective, typeof i8.LoadingModule, typeof i8.IconModule, typeof i11.OverflowMenuComponent, typeof i11.OverflowMenuOptionComponent, typeof i11.OverflowMenuTriggerComponent, typeof i8.NotificationModule, typeof i11.CarbonListModule, typeof i8.TabsModule, typeof i12.AccessControlJsonEditorTabComponent, typeof i13.AccessControlOverviewTabComponent], never>;
23
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AccessControlManagementModule, [typeof i1.AccessControlOverviewComponent, typeof i2.RoleMetadataModalComponent, typeof i3.AccessControlEditorComponent, typeof i4.AccessControlFormEditorTabComponent, typeof i5.ConditionTreeComponent, typeof i6.DeleteRoleModalComponent, typeof i7.ExportRoleModalComponent, typeof i8.PermissionFormComponent], [typeof i9.CommonModule, typeof i10.AccessControlManagementRoutingModule, typeof i11.ButtonModule, typeof i12.FormsModule, typeof i11.ModalModule, typeof i13.TranslateModule, typeof i12.ReactiveFormsModule, typeof i11.InputModule, typeof i11.IconModule, typeof i14.ConfirmationModalModule, typeof i14.RenderInPageHeaderDirective, typeof i14.FitPageDirective, typeof i11.LoadingModule, typeof i11.IconModule, typeof i14.OverflowMenuComponent, typeof i14.OverflowMenuOptionComponent, typeof i14.OverflowMenuTriggerComponent, typeof i11.NotificationModule, typeof i14.CarbonListModule, typeof i14.SelectModule, typeof i14.TooltipIconModule, typeof i11.TabsModule, typeof i11.ToggleModule, typeof i11.ContentSwitcherModule, typeof i11.AccordionModule, typeof i11.CheckboxModule, typeof i11.LayerModule, typeof i11.TagModule, typeof i15.AccessControlJsonEditorTabComponent, typeof i16.AccessControlOverviewTabComponent, typeof i17.ActionLabelPipe, typeof i18.ActionDescriptionPipe, typeof i19.ActionTagTypePipe], never>;
18
24
  static ɵinj: i0.ɵɵInjectorDeclaration<AccessControlManagementModule>;
19
25
  }
@@ -0,0 +1,69 @@
1
+ import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { AbstractControl, FormArray } from '@angular/forms';
3
+ import { EditorModel } from '@valtimo/components';
4
+ import { IconService } from 'carbon-components-angular';
5
+ import { AccessControlFormEditorService, PermissionSchemaMetadataService } from '../../services';
6
+ import * as i0 from "@angular/core";
7
+ export declare class AccessControlFormEditorTabComponent implements OnChanges, OnDestroy {
8
+ private readonly formEditorService;
9
+ private readonly metadataService;
10
+ private readonly iconService;
11
+ private readonly changeDetectorRef;
12
+ private _permissionList?;
13
+ model: EditorModel | null;
14
+ disabled: boolean | null;
15
+ roleKey: string | null;
16
+ validEvent: EventEmitter<boolean>;
17
+ valueChangeEvent: EventEmitter<string>;
18
+ permissionsArray: FormArray | null;
19
+ ready: boolean;
20
+ readonly $selectedIndex: import("@angular/core").WritableSignal<number>;
21
+ protected readonly testIds: {
22
+ readonly addPermissionButton: "accessControlEditorAddPermission";
23
+ readonly permissionListItem: "accessControlEditorPermissionListItem";
24
+ readonly permissionCard: "accessControlEditorPermissionCard";
25
+ readonly removePermissionButton: "accessControlEditorRemovePermission";
26
+ readonly resourceTypeSelect: "accessControlEditorResourceType";
27
+ readonly actionsSelect: "accessControlEditorActions";
28
+ readonly contextToggle: "accessControlEditorContextToggle";
29
+ readonly contextResourceTypeSelect: "accessControlEditorContextResourceType";
30
+ readonly addConditionButton: "accessControlEditorAddCondition";
31
+ readonly removeConditionButton: "accessControlEditorRemoveCondition";
32
+ readonly conditionTypeSelect: "accessControlEditorConditionType";
33
+ readonly conditionFieldSelect: "accessControlEditorConditionField";
34
+ readonly conditionOperatorSelect: "accessControlEditorConditionOperator";
35
+ readonly conditionValueInput: "accessControlEditorConditionValue";
36
+ readonly conditionPathInput: "accessControlEditorConditionPath";
37
+ readonly conditionClazzInput: "accessControlEditorConditionClazz";
38
+ };
39
+ private _valueChangesSubscription?;
40
+ private _pendingReselect;
41
+ constructor(formEditorService: AccessControlFormEditorService, metadataService: PermissionSchemaMetadataService, iconService: IconService, changeDetectorRef: ChangeDetectorRef);
42
+ ngOnChanges(changes: SimpleChanges): void;
43
+ ngOnDestroy(): void;
44
+ shortName(control: AbstractControl): string;
45
+ actionsOf(control: AbstractControl): string[];
46
+ hasConditions(control: AbstractControl): boolean;
47
+ hasContext(control: AbstractControl): boolean;
48
+ orderedPermissions(): {
49
+ control: AbstractControl;
50
+ index: number;
51
+ }[];
52
+ selectPermission(index: number): void;
53
+ selectedControls(): AbstractControl[];
54
+ addPermission(): void;
55
+ private scrollNewPermissionIntoView;
56
+ private scrollSelectedIntoView;
57
+ removePermission(index: number): void;
58
+ private rebuild;
59
+ private buildForm;
60
+ prepareSelectionReopen(): void;
61
+ private selectedPermissionKeys;
62
+ private resolveSelectedIndex;
63
+ private permissionKeys;
64
+ private applyDisabled;
65
+ private emitState;
66
+ private parsePermissions;
67
+ static ɵfac: i0.ɵɵFactoryDeclaration<AccessControlFormEditorTabComponent, never>;
68
+ static ɵcmp: i0.ɵɵComponentDeclaration<AccessControlFormEditorTabComponent, "valtimo-access-control-form-editor-tab", never, { "model": { "alias": "model"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "roleKey": { "alias": "roleKey"; "required": false; }; }, { "validEvent": "validEvent"; "valueChangeEvent": "valueChangeEvent"; }, never, never, false, never>;
69
+ }
@@ -0,0 +1,62 @@
1
+ import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
+ import { AbstractControl, FormArray, FormGroup } from '@angular/forms';
3
+ import { SelectItem } from '@valtimo/components';
4
+ import { IconService } from 'carbon-components-angular';
5
+ import { ConditionType } from '../../models';
6
+ import { AccessControlFormEditorService } from '../../services';
7
+ import * as i0 from "@angular/core";
8
+ export declare class ConditionTreeComponent implements OnInit, OnChanges {
9
+ private readonly formEditorService;
10
+ private readonly iconService;
11
+ conditions: FormArray;
12
+ resourceType: string | null;
13
+ disabled: boolean;
14
+ depth: number;
15
+ fieldItems: SelectItem[];
16
+ containerTargetItems: SelectItem[];
17
+ operatorItems: SelectItem[];
18
+ valueTypeItems: SelectItem[];
19
+ typeItems: SelectItem[];
20
+ protected readonly testIds: {
21
+ readonly addPermissionButton: "accessControlEditorAddPermission";
22
+ readonly permissionListItem: "accessControlEditorPermissionListItem";
23
+ readonly permissionCard: "accessControlEditorPermissionCard";
24
+ readonly removePermissionButton: "accessControlEditorRemovePermission";
25
+ readonly resourceTypeSelect: "accessControlEditorResourceType";
26
+ readonly actionsSelect: "accessControlEditorActions";
27
+ readonly contextToggle: "accessControlEditorContextToggle";
28
+ readonly contextResourceTypeSelect: "accessControlEditorContextResourceType";
29
+ readonly addConditionButton: "accessControlEditorAddCondition";
30
+ readonly removeConditionButton: "accessControlEditorRemoveCondition";
31
+ readonly conditionTypeSelect: "accessControlEditorConditionType";
32
+ readonly conditionFieldSelect: "accessControlEditorConditionField";
33
+ readonly conditionOperatorSelect: "accessControlEditorConditionOperator";
34
+ readonly conditionValueInput: "accessControlEditorConditionValue";
35
+ readonly conditionPathInput: "accessControlEditorConditionPath";
36
+ readonly conditionClazzInput: "accessControlEditorConditionClazz";
37
+ };
38
+ get rowLayerLevel(): 1 | 2;
39
+ get inputLayerLevel(): 1 | 2;
40
+ constructor(formEditorService: AccessControlFormEditorService, iconService: IconService);
41
+ ngOnInit(): void;
42
+ ngOnChanges(changes: SimpleChanges): void;
43
+ groupAt(index: number): FormGroup;
44
+ asFormGroup(control: AbstractControl): FormGroup;
45
+ typeOf(index: number): ConditionType;
46
+ nestedConditions(index: number): FormArray;
47
+ containerResourceType(index: number): string | null;
48
+ containerResourceTypeAt(index: number): string;
49
+ fieldValueAt(index: number): string;
50
+ operatorValueAt(index: number): string;
51
+ clazzValueAt(index: number): string;
52
+ clazzManualAt(index: number): boolean;
53
+ addCondition(): void;
54
+ removeCondition(index: number): void;
55
+ onClazzManualToggle(index: number, manual: boolean): void;
56
+ onTypeChange(index: number): void;
57
+ private recomputeItems;
58
+ private collectFieldValues;
59
+ private collectContainerTargets;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConditionTreeComponent, never>;
61
+ static ɵcmp: i0.ɵɵComponentDeclaration<ConditionTreeComponent, "valtimo-condition-tree", never, { "conditions": { "alias": "conditions"; "required": false; }; "resourceType": { "alias": "resourceType"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "depth": { "alias": "depth"; "required": false; }; }, {}, never, never, false, never>;
62
+ }
@@ -2,13 +2,13 @@ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { AccessControlService } from '../../services/access-control.service';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import { ActivatedRoute, Router } from '@angular/router';
5
- import { EditorModel, PageHeaderService, PageTitleService } from '@valtimo/components';
5
+ import { EditorModel, PageHeaderService, PageTitleService, PendingChangesComponent } from '@valtimo/components';
6
6
  import { AccessControlEditorTab, Permission, Role } from '../../models';
7
7
  import { TranslateService } from '@ngx-translate/core';
8
8
  import { AccessControlExportService } from '../../services/access-control-export.service';
9
9
  import { GlobalNotificationService } from '@valtimo/shared';
10
10
  import * as i0 from "@angular/core";
11
- export declare class AccessControlEditorComponent implements OnInit, OnDestroy {
11
+ export declare class AccessControlEditorComponent extends PendingChangesComponent implements OnInit, OnDestroy {
12
12
  private readonly accessControlService;
13
13
  private readonly route;
14
14
  private readonly pageTitleService;
@@ -29,24 +29,30 @@ export declare class AccessControlEditorComponent implements OnInit, OnDestroy {
29
29
  readonly compactMode$: import("rxjs").Observable<boolean>;
30
30
  readonly $activeTab: import("@angular/core").WritableSignal<AccessControlEditorTab>;
31
31
  protected readonly AccessControlEditorTab: typeof AccessControlEditorTab;
32
+ private _tabs;
33
+ private _formEditorTab?;
32
34
  private _roleKeySubscription;
33
35
  private _roleKey;
34
36
  private readonly _updatedModelValue$;
37
+ private _pendingBaseline;
35
38
  constructor(accessControlService: AccessControlService, route: ActivatedRoute, pageTitleService: PageTitleService, router: Router, globalNotificationService: GlobalNotificationService, translateService: TranslateService, accessControlExportService: AccessControlExportService, pageHeaderService: PageHeaderService);
36
39
  ngOnInit(): void;
37
40
  ngOnDestroy(): void;
38
41
  onValid(valid: boolean): void;
39
42
  onValueChange(value: string): void;
43
+ private normalizeJson;
44
+ protected onCancelRedirect(): void;
45
+ private syncTabHeaders;
40
46
  updatePermissions(): void;
41
47
  onDelete(roles: Array<string>): void;
42
48
  showDeleteModal(): void;
43
49
  showEditModal(): void;
44
50
  onEdit(currentRoleKey: string, data: Role | null): void;
45
51
  setActiveTab(tab: AccessControlEditorTab): void;
52
+ private segmentsForTab;
46
53
  private restoreActiveTabFromUrl;
47
54
  exportPermissions(): void;
48
55
  private openRoleKeySubscription;
49
- private getPermissions;
50
56
  private setModel;
51
57
  private disableMore;
52
58
  private enableMore;
@@ -13,6 +13,7 @@ export declare class AccessControlOverviewComponent implements OnInit {
13
13
  carbonList: CarbonListComponent;
14
14
  fields: ColumnConfig[];
15
15
  readonly roles$: Observable<Role[]>;
16
+ readonly existingRoleKeys$: Observable<string[]>;
16
17
  readonly loading$: Observable<boolean>;
17
18
  readonly skeleton$: BehaviorSubject<boolean>;
18
19
  readonly showAddModal$: BehaviorSubject<boolean>;
@@ -0,0 +1,69 @@
1
+ import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { FormArray, FormControl, FormGroup } from '@angular/forms';
3
+ import { SelectItem } from '@valtimo/components';
4
+ import { IconService } from 'carbon-components-angular';
5
+ import { BehaviorSubject } from 'rxjs';
6
+ import { AccessControlFormEditorService } from '../../services';
7
+ import * as i0 from "@angular/core";
8
+ export declare class PermissionFormComponent implements OnInit, AfterViewInit, OnDestroy {
9
+ private readonly formEditorService;
10
+ private readonly iconService;
11
+ private readonly changeDetectorRef;
12
+ group: FormGroup;
13
+ index: number;
14
+ disabled: boolean;
15
+ roleKey: string | null;
16
+ removeEvent: EventEmitter<void>;
17
+ resourceTypeItems: SelectItem[];
18
+ actionItems: SelectItem[];
19
+ contextResourceTypeItems: SelectItem[];
20
+ hasContextTargets: boolean;
21
+ readonly $loading: import("@angular/core").WritableSignal<boolean>;
22
+ readonly $openSection: import("@angular/core").WritableSignal<"conditions" | "resourceActions" | "context">;
23
+ readonly showRemoveModal$: BehaviorSubject<boolean>;
24
+ protected readonly testIds: {
25
+ readonly addPermissionButton: "accessControlEditorAddPermission";
26
+ readonly permissionListItem: "accessControlEditorPermissionListItem";
27
+ readonly permissionCard: "accessControlEditorPermissionCard";
28
+ readonly removePermissionButton: "accessControlEditorRemovePermission";
29
+ readonly resourceTypeSelect: "accessControlEditorResourceType";
30
+ readonly actionsSelect: "accessControlEditorActions";
31
+ readonly contextToggle: "accessControlEditorContextToggle";
32
+ readonly contextResourceTypeSelect: "accessControlEditorContextResourceType";
33
+ readonly addConditionButton: "accessControlEditorAddCondition";
34
+ readonly removeConditionButton: "accessControlEditorRemoveCondition";
35
+ readonly conditionTypeSelect: "accessControlEditorConditionType";
36
+ readonly conditionFieldSelect: "accessControlEditorConditionField";
37
+ readonly conditionOperatorSelect: "accessControlEditorConditionOperator";
38
+ readonly conditionValueInput: "accessControlEditorConditionValue";
39
+ readonly conditionPathInput: "accessControlEditorConditionPath";
40
+ readonly conditionClazzInput: "accessControlEditorConditionClazz";
41
+ };
42
+ private readonly _subscriptions;
43
+ private _revealTimeoutId?;
44
+ constructor(formEditorService: AccessControlFormEditorService, iconService: IconService, changeDetectorRef: ChangeDetectorRef);
45
+ get resourceTypeValue(): string;
46
+ get resourceShortName(): string;
47
+ get contextResourceTypeValue(): string | null;
48
+ get hasContext(): boolean;
49
+ get hasContextResource(): boolean;
50
+ get contextMode(): 'none' | 'noContext' | 'specific';
51
+ get actionsControl(): FormControl;
52
+ get selectedActions(): string[];
53
+ get conditionsArray(): FormArray;
54
+ get contextConditionsArray(): FormArray;
55
+ ngOnInit(): void;
56
+ ngAfterViewInit(): void;
57
+ ngOnDestroy(): void;
58
+ onContextModeChange(mode: 'none' | 'noContext' | 'specific'): void;
59
+ onActionToggle(action: string, checked: boolean): void;
60
+ onSectionToggle(section: 'resourceActions' | 'conditions' | 'context', event: {
61
+ expanded?: boolean;
62
+ }): void;
63
+ openRemoveModal(): void;
64
+ onRemove(): void;
65
+ private recomputeActionItems;
66
+ private recomputeContextResourceTypeItems;
67
+ static ɵfac: i0.ɵɵFactoryDeclaration<PermissionFormComponent, never>;
68
+ static ɵcmp: i0.ɵɵComponentDeclaration<PermissionFormComponent, "valtimo-permission-form", never, { "group": { "alias": "group"; "required": false; }; "index": { "alias": "index"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "roleKey": { "alias": "roleKey"; "required": false; }; }, { "removeEvent": "removeEvent"; }, never, never, false, never>;
69
+ }
@@ -1,23 +1,36 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { FormBuilder } from '@angular/forms';
3
+ import { SelectItem } from '@valtimo/components';
3
4
  import { Role, RoleMetadataModal } from '../../models';
5
+ import { AccessControlService } from '../../services';
4
6
  import * as i0 from "@angular/core";
5
- export declare class RoleMetadataModalComponent {
7
+ export declare class RoleMetadataModalComponent implements OnInit {
6
8
  private readonly fb;
7
- open: boolean;
9
+ private readonly accessControlService;
8
10
  type: RoleMetadataModal;
11
+ set open(value: boolean);
12
+ get open(): boolean;
9
13
  set defaultKeyValue(value: string);
14
+ usedKeys: string[] | null;
10
15
  closeEvent: EventEmitter<Role>;
16
+ readonly $roleKeyItems: import("@angular/core").WritableSignal<SelectItem[]>;
17
+ readonly $loadingRoles: import("@angular/core").WritableSignal<boolean>;
18
+ readonly $keyManual: import("@angular/core").WritableSignal<boolean>;
11
19
  form: import("@angular/forms").FormGroup<{
12
20
  key: import("@angular/forms").FormControl<string>;
13
21
  }>;
22
+ private _open;
14
23
  private _defaultKeyValue;
24
+ private _rolesRequested;
15
25
  get key(): import("@angular/forms").AbstractControl<string, string>;
16
- constructor(fb: FormBuilder);
26
+ constructor(fb: FormBuilder, accessControlService: AccessControlService);
27
+ ngOnInit(): void;
17
28
  onCancel(): void;
18
29
  onConfirm(): void;
30
+ onKeyManualToggle(manual: boolean): void;
31
+ private loadRoleKeyItems;
19
32
  private setDefaultKeyValue;
20
33
  private resetForm;
21
34
  static ɵfac: i0.ɵɵFactoryDeclaration<RoleMetadataModalComponent, never>;
22
- static ɵcmp: i0.ɵɵComponentDeclaration<RoleMetadataModalComponent, "valtimo-role-metadata-modal", never, { "open": { "alias": "open"; "required": false; }; "type": { "alias": "type"; "required": false; }; "defaultKeyValue": { "alias": "defaultKeyValue"; "required": false; }; }, { "closeEvent": "closeEvent"; }, never, never, false, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<RoleMetadataModalComponent, "valtimo-role-metadata-modal", never, { "type": { "alias": "type"; "required": false; }; "open": { "alias": "open"; "required": false; }; "defaultKeyValue": { "alias": "defaultKeyValue"; "required": false; }; "usedKeys": { "alias": "usedKeys"; "required": false; }; }, { "closeEvent": "closeEvent"; }, never, never, false, never>;
23
36
  }
@@ -0,0 +1,19 @@
1
+ declare const ACCESS_CONTROL_EDITOR_TEST_IDS: {
2
+ readonly addPermissionButton: "accessControlEditorAddPermission";
3
+ readonly permissionListItem: "accessControlEditorPermissionListItem";
4
+ readonly permissionCard: "accessControlEditorPermissionCard";
5
+ readonly removePermissionButton: "accessControlEditorRemovePermission";
6
+ readonly resourceTypeSelect: "accessControlEditorResourceType";
7
+ readonly actionsSelect: "accessControlEditorActions";
8
+ readonly contextToggle: "accessControlEditorContextToggle";
9
+ readonly contextResourceTypeSelect: "accessControlEditorContextResourceType";
10
+ readonly addConditionButton: "accessControlEditorAddCondition";
11
+ readonly removeConditionButton: "accessControlEditorRemoveCondition";
12
+ readonly conditionTypeSelect: "accessControlEditorConditionType";
13
+ readonly conditionFieldSelect: "accessControlEditorConditionField";
14
+ readonly conditionOperatorSelect: "accessControlEditorConditionOperator";
15
+ readonly conditionValueInput: "accessControlEditorConditionValue";
16
+ readonly conditionPathInput: "accessControlEditorConditionPath";
17
+ readonly conditionClazzInput: "accessControlEditorConditionClazz";
18
+ };
19
+ export { ACCESS_CONTROL_EDITOR_TEST_IDS };
@@ -1,4 +1,6 @@
1
1
  import { ConditionOperator } from '../models';
2
2
  declare const OPERATOR_LABEL: Record<ConditionOperator, string>;
3
3
  declare const NO_CONTEXT_RESOURCE_TYPE = "com.ritense.authorization.NoContext";
4
- export { NO_CONTEXT_RESOURCE_TYPE, OPERATOR_LABEL };
4
+ declare const ACTION_TAG_TYPE: Record<string, string>;
5
+ declare const DEFAULT_ACTION_TAG_TYPE = "gray";
6
+ export { ACTION_TAG_TYPE, DEFAULT_ACTION_TAG_TYPE, NO_CONTEXT_RESOURCE_TYPE, OPERATOR_LABEL };
@@ -1 +1,2 @@
1
+ export * from './access-control-editor.test-ids';
1
2
  export * from './access-control-labels';
@@ -1,5 +1,6 @@
1
1
  declare enum AccessControlEditorTab {
2
2
  SUMMARY = "summary",
3
+ EDITOR = "editor",
3
4
  JSON_EDITOR = "jsonEditor"
4
5
  }
5
6
  interface AccessControlFilter {
@@ -1,4 +1,5 @@
1
1
  export * from './access-control-editor-tab.model';
2
+ export * from './pbac-editor.model';
2
3
  export * from './permission.model';
3
4
  export * from './permission-schema.model';
4
5
  export * from './role.model';
@@ -0,0 +1,10 @@
1
+ import { PermissionCondition } from './permission.model';
2
+ type ConditionType = 'field' | 'expression' | 'container';
3
+ interface UpdateRolePermission {
4
+ resourceType: string;
5
+ actions: string[];
6
+ conditions: PermissionCondition[];
7
+ contextResourceType?: string;
8
+ contextConditions?: PermissionCondition[];
9
+ }
10
+ export { ConditionType, UpdateRolePermission };
@@ -0,0 +1,10 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ActionDescriptionPipe implements PipeTransform {
5
+ private readonly translateService;
6
+ constructor(translateService: TranslateService);
7
+ transform(action: string | null | undefined): string;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<ActionDescriptionPipe, never>;
9
+ static ɵpipe: i0.ɵɵPipeDeclaration<ActionDescriptionPipe, "actionDescription", true>;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ActionLabelPipe implements PipeTransform {
5
+ private readonly translateService;
6
+ constructor(translateService: TranslateService);
7
+ transform(action: string | null | undefined): string;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<ActionLabelPipe, never>;
9
+ static ɵpipe: i0.ɵɵPipeDeclaration<ActionLabelPipe, "actionLabel", true>;
10
+ }
@@ -0,0 +1,8 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { TagType } from 'carbon-components-angular';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ActionTagTypePipe implements PipeTransform {
5
+ transform(action: string | null | undefined): TagType;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<ActionTagTypePipe, never>;
7
+ static ɵpipe: i0.ɵɵPipeDeclaration<ActionTagTypePipe, "actionTagType", true>;
8
+ }
@@ -1 +1,4 @@
1
+ export * from './action-description.pipe';
2
+ export * from './action-label.pipe';
3
+ export * from './action-tag-type.pipe';
1
4
  export * from './resource-type-label.pipe';
@@ -0,0 +1,37 @@
1
+ import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
2
+ import { SelectItem } from '@valtimo/components';
3
+ import { PbacRegistryDto } from '@valtimo/shared';
4
+ import { ConditionType, Permission, PermissionCondition, UpdateRolePermission } from '../models';
5
+ import * as i0 from "@angular/core";
6
+ export declare class AccessControlFormEditorService {
7
+ private readonly fb;
8
+ private _resources;
9
+ private _resourceByType;
10
+ private _operatorKeys;
11
+ constructor(fb: FormBuilder);
12
+ setRegistry(registry: PbacRegistryDto): void;
13
+ buildPermissionsArray(permissions: Permission[]): FormArray;
14
+ createPermissionGroup(permission?: Permission): FormGroup;
15
+ createConditionGroup(condition?: PermissionCondition, type?: ConditionType): FormGroup;
16
+ serialize(permissionsArray: FormArray): UpdateRolePermission[];
17
+ serializePermission(group: FormGroup): UpdateRolePermission;
18
+ private serializeConditions;
19
+ resourceTypeItems(include?: string | string[] | null): SelectItem[];
20
+ contextResourceTypeItems(resourceType: string, include?: string | string[] | null): SelectItem[];
21
+ actionItems(resourceType: string, include?: string | string[] | null): SelectItem[];
22
+ fieldItems(resourceType: string, include?: string | string[] | null): SelectItem[];
23
+ containerTargetItems(resourceType: string, include?: string | string[] | null): SelectItem[];
24
+ operatorItems(): SelectItem[];
25
+ valueTypeItems(include?: string | string[] | null): SelectItem[];
26
+ get defaultValueType(): string;
27
+ isCustomValueType(clazz: string): boolean;
28
+ private normalizeActions;
29
+ private conditionField;
30
+ private conditionOperator;
31
+ private conditionValue;
32
+ private conditionClazz;
33
+ private withIncluded;
34
+ private sortByText;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<AccessControlFormEditorService, never>;
36
+ static ɵprov: i0.ɵɵInjectableDeclaration<AccessControlFormEditorService>;
37
+ }
@@ -1,5 +1,5 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
- import { ConfigService } from '@valtimo/shared';
2
+ import { ConfigService, PbacRegistryDto } from '@valtimo/shared';
3
3
  import { BehaviorSubject, Observable } from 'rxjs';
4
4
  import { DeleteRolesRequest, Permission, PermissionSchema, Role } from '../models';
5
5
  import * as i0 from "@angular/core";
@@ -9,8 +9,10 @@ export declare class AccessControlService {
9
9
  readonly roles$: BehaviorSubject<Role[]>;
10
10
  readonly loading$: BehaviorSubject<boolean>;
11
11
  private valtimoEndpointUri;
12
+ private readonly apiEndpointUri;
12
13
  private get roleDtos$();
13
14
  constructor(configService: ConfigService, http: HttpClient);
15
+ getExternalRoles(externalRoleNamePrefix?: string): Observable<string[]>;
14
16
  addRole(role: Role): Observable<Role>;
15
17
  deleteRoles(request: DeleteRolesRequest): Observable<null>;
16
18
  dispatchAction(actionResult: Observable<Role | null>): void;
@@ -19,6 +21,7 @@ export declare class AccessControlService {
19
21
  exportRolePermissions(roles: string[]): Observable<object[]>;
20
22
  updateRolePermissions(roleKey: string, updatedPermission: object): Observable<object>;
21
23
  getPermissionSchema(): Observable<PermissionSchema>;
24
+ getPbacRegistry(): Observable<PbacRegistryDto>;
22
25
  updateRole(roleKey: string, request: Role): Observable<object>;
23
26
  static ɵfac: i0.ɵɵFactoryDeclaration<AccessControlService, never>;
24
27
  static ɵprov: i0.ɵɵInjectableDeclaration<AccessControlService>;
@@ -1,2 +1,3 @@
1
+ export * from './access-control-form-editor.service';
1
2
  export * from './access-control.service';
2
3
  export * from './permission-schema-metadata.service';
@@ -1,3 +1,4 @@
1
+ import { PbacConditionTypeDto, PbacEntityMapperDto, PbacOperatorDto, PbacRegistryDto, PbacResourceDto } from '@valtimo/shared';
1
2
  import { Observable } from 'rxjs';
2
3
  import { PermissionSchema } from '../models';
3
4
  import { AccessControlService } from './access-control.service';
@@ -6,13 +7,30 @@ export declare class PermissionSchemaMetadataService {
6
7
  private readonly accessControlService;
7
8
  private readonly _knownResourceTypes$;
8
9
  private readonly _fieldsByResourceType$;
10
+ /**
11
+ * The full PBAC registry served by GET /api/management/v1/pbac/registry. This is the
12
+ * authoritative, purpose-built description of every resource type, its actions and fields,
13
+ * the available operators and condition types, the entity-mapper pairs that define which
14
+ * context resources a permission can be scoped to, and the configured roles. It drives both
15
+ * the read-only overview and the form-based editor.
16
+ */
17
+ readonly registry$: Observable<PbacRegistryDto>;
18
+ readonly resources$: Observable<PbacResourceDto[]>;
19
+ readonly resourceByType$: Observable<Record<string, PbacResourceDto>>;
20
+ /**
21
+ * Raw JSON schema served by GET /api/management/v1/permissions/schema. Drives validation and
22
+ * autocomplete in the Monaco JSON editor.
23
+ */
9
24
  readonly schema$: Observable<PermissionSchema>;
10
25
  readonly actionsByResourceType$: Observable<Record<string, string[]>>;
11
26
  readonly allResourceTypes$: Observable<string[]>;
27
+ readonly operators$: Observable<PbacOperatorDto[]>;
28
+ readonly conditionTypes$: Observable<PbacConditionTypeDto[]>;
29
+ readonly entityMappers$: Observable<PbacEntityMapperDto[]>;
30
+ readonly roles$: Observable<string[]>;
12
31
  constructor(accessControlService: AccessControlService);
13
32
  isResourceTypeKnown(fqn: string): boolean;
14
33
  isFieldKnown(resourceType: string, field: string): boolean;
15
- private extractActionsByResourceType;
16
34
  private extractKnownResourceTypes;
17
35
  private extractFieldsByResourceType;
18
36
  static ɵfac: i0.ɵɵFactoryDeclaration<PermissionSchemaMetadataService, never>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Render a stored condition value as editable text.
3
+ * - undefined -> empty string (no value set, e.g. a freshly-added condition)
4
+ * - null -> the literal "null" (so an intentional null reads as deliberate rather than an unfilled
5
+ * field, and still round-trips back to null through textToValue)
6
+ * - string -> the raw string (so '${currentUserId}' and 'someKey' show without quotes)
7
+ * - everything else (number, boolean, array, object) -> its JSON representation
8
+ */
9
+ declare function valueToText(value: unknown): string;
10
+ /**
11
+ * Parse editable text back into a stored condition value.
12
+ * - empty string -> null
13
+ * - valid JSON (number, boolean, null, array, object, quoted string) -> the parsed value
14
+ * - anything else -> the raw string (so 'view' or '${currentUserId}' stay strings)
15
+ */
16
+ declare function textToValue(text: string): unknown;
17
+ export { textToValue, valueToText };
@@ -1 +1,3 @@
1
+ export * from './condition-value';
1
2
  export * from './format-condition';
3
+ export * from './resource-name';
@@ -0,0 +1,4 @@
1
+ import { SelectItem } from '@valtimo/components';
2
+ declare function shortTypeName(fullyQualifiedName: string): string;
3
+ declare function fqnSelectItem(fullyQualifiedName: string): SelectItem;
4
+ export { fqnSelectItem, shortTypeName };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valtimo/access-control-management",
3
- "version": "13.35.0",
3
+ "version": "13.36.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "19.2.20",
6
6
  "@angular/core": "19.2.20"