diff --git a/packages/context/src/lib/context-manager/shared/context.service.ts b/packages/context/src/lib/context-manager/shared/context.service.ts index 7ce5171454..a5f20cf07b 100644 --- a/packages/context/src/lib/context-manager/shared/context.service.ts +++ b/packages/context/src/lib/context-manager/shared/context.service.ts @@ -29,7 +29,7 @@ import { } from '@igo2/core'; import { AuthService } from '@igo2/auth'; -import type { IgoMap, Layer } from '@igo2/geo'; +import type { IgoMap, Layer, LayerOptions } from '@igo2/geo'; import { TypePermission } from './context.enum'; import { @@ -476,8 +476,9 @@ export class ContextService { layerOptions: { title: layer.options.title, zIndex: ++i, - visible: layer.visible - }, + visible: layer.visible, + security: layer.security + } as LayerOptions, sourceOptions: { type: layer.dataSource.options.type, params: layer.dataSource.options.params, diff --git a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.component.ts b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.component.ts index 5986d75335..0b1093fb5c 100644 --- a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.component.ts +++ b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.component.ts @@ -159,6 +159,9 @@ export class CatalogBrowserComponent implements OnInit, OnDestroy { if (!layer.options.sourceOptions.optionsFromApi) { layer.options.sourceOptions.optionsFromApi = true; } + if (this.catalog.profils?.length) { + layer.options.security = { profils: this.catalog.profils }; + } return this.layerService.createAsyncLayer(layer.options); }); diff --git a/packages/geo/src/lib/catalog/shared/catalog.abstract.ts b/packages/geo/src/lib/catalog/shared/catalog.abstract.ts index add72c5ca2..f27d12fda5 100644 --- a/packages/geo/src/lib/catalog/shared/catalog.abstract.ts +++ b/packages/geo/src/lib/catalog/shared/catalog.abstract.ts @@ -36,6 +36,7 @@ export abstract class Catalog implements ICatalog { sortDirection?: 'asc' | 'desc'; setCrossOriginAnonymous?: boolean; showLegend?: boolean; + profils?: string[]; // ICatalog ----------------------------- protected catalogService: CatalogService; diff --git a/packages/geo/src/lib/layer/shared/layers/layer.interface.ts b/packages/geo/src/lib/layer/shared/layers/layer.interface.ts index 8c14d354b1..5a8f6a9d31 100644 --- a/packages/geo/src/lib/layer/shared/layers/layer.interface.ts +++ b/packages/geo/src/lib/layer/shared/layers/layer.interface.ts @@ -13,6 +13,7 @@ export interface LayerOptions { title?: string; id?: string; alias?: string; + security?: LayerSecurityOptions; baseLayer?: boolean; opacity?: number; visible?: boolean; @@ -36,6 +37,10 @@ export interface LayerOptions { showButtonZoomToExtent?: boolean; } +export interface LayerSecurityOptions { + profils?: string[] +} + export interface GeoWorkspaceOptions { srcId?: string; workspaceId?: string;