DM-384 hide layout grid button based on permissions
This commit is contained in:
parent
a463d92450
commit
11f0487f78
@ -1,5 +1,5 @@
|
||||
import { inject, Injectable, isDevMode, NgZone } from '@angular/core';
|
||||
import { getConfig, IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { inject, Injectable, NgZone } from '@angular/core';
|
||||
import { getConfig, IqserPermissionsService, isIqserDevMode } from '@iqser/common-ui';
|
||||
import { BASE_HREF_FN } from '@iqser/common-ui/lib/utils';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { IHeaderElement, RotationTypes } from '@red/domain';
|
||||
@ -27,10 +27,13 @@ export class ViewerHeaderService {
|
||||
readonly #iqserPermissionService = inject(IqserPermissionsService);
|
||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||
#buttons: Map<HeaderElementType, IHeaderElement>;
|
||||
readonly #panels = ['thumbnailsPanel', 'outlinesPanel', 'layersPanel', 'signaturePanel'];
|
||||
#docBeforeCompare: Blob;
|
||||
readonly #events$ = new Subject<ViewerEvent>();
|
||||
readonly #config = new Map<HeaderElementType, boolean>([
|
||||
[HeaderElements.SHAPE_TOOL_GROUP_BUTTON, !this.#iqserPermissionService.has(Roles.getRss)],
|
||||
[HeaderElements.TOGGLE_TOOLTIPS, true],
|
||||
[HeaderElements.TOGGLE_LAYERS, this.#isDocumine || isDevMode()],
|
||||
[HeaderElements.TOGGLE_LAYERS, isIqserDevMode() || (this.#isDocumine && this.#iqserPermissionService.has(Roles.rules.write))],
|
||||
[HeaderElements.TOGGLE_READABLE_REDACTIONS, false],
|
||||
[HeaderElements.LOAD_ALL_ANNOTATIONS, false],
|
||||
[HeaderElements.COMPARE_BUTTON, !this.#isDocumine],
|
||||
@ -40,9 +43,6 @@ export class ViewerHeaderService {
|
||||
[HeaderElements.APPLY_ROTATION, false],
|
||||
[HeaderElements.DISCARD_ROTATION, false],
|
||||
]);
|
||||
readonly #panels = ['thumbnailsPanel', 'outlinesPanel', 'layersPanel', 'signaturePanel'];
|
||||
#docBeforeCompare: Blob;
|
||||
readonly #events$ = new Subject<ViewerEvent>();
|
||||
readonly events$: Observable<ViewerEvent>;
|
||||
toggleLoadAnnotations$: Observable<boolean>;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user