From 9a511968b1521fae919e2e05a2495ddfe7818be0 Mon Sep 17 00:00:00 2001 From: MT Lewis Date: Mon, 17 Jan 2022 17:57:09 +0000 Subject: [PATCH] search-common: add optional visibilityPermission property to DocumentCollator type Signed-off-by: MT Lewis --- .changeset/nasty-dodos-complain.md | 5 +++++ packages/search-common/api-report.md | 2 ++ packages/search-common/package.json | 3 ++- packages/search-common/src/types.ts | 9 +++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .changeset/nasty-dodos-complain.md diff --git a/.changeset/nasty-dodos-complain.md b/.changeset/nasty-dodos-complain.md new file mode 100644 index 0000000000..24e53f08d8 --- /dev/null +++ b/.changeset/nasty-dodos-complain.md @@ -0,0 +1,5 @@ +--- +'@backstage/search-common': patch +--- + +Add optional visibilityPermission property to DocumentCollator type diff --git a/packages/search-common/api-report.md b/packages/search-common/api-report.md index e63caf016f..ec5a671d33 100644 --- a/packages/search-common/api-report.md +++ b/packages/search-common/api-report.md @@ -4,6 +4,7 @@ ```ts import { JsonObject } from '@backstage/types'; +import { Permission } from '@backstage/plugin-permission-common'; // Warning: (ae-missing-release-tag) "DocumentCollator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -12,6 +13,7 @@ export interface DocumentCollator { // (undocumented) execute(): Promise; readonly type: string; + readonly visibilityPermission?: Permission; } // Warning: (ae-missing-release-tag) "DocumentDecorator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) diff --git a/packages/search-common/package.json b/packages/search-common/package.json index 9dabf6dd1a..ba587d9904 100644 --- a/packages/search-common/package.json +++ b/packages/search-common/package.json @@ -36,7 +36,8 @@ "url": "https://github.com/backstage/backstage/issues" }, "dependencies": { - "@backstage/types": "^0.1.1" + "@backstage/types": "^0.1.1", + "@backstage/plugin-permission-common": "^0.4.0-next.0" }, "devDependencies": { "@backstage/cli": "^0.12.0-next.0" diff --git a/packages/search-common/src/types.ts b/packages/search-common/src/types.ts index e8d21535bb..8dd4c58b0e 100644 --- a/packages/search-common/src/types.ts +++ b/packages/search-common/src/types.ts @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +import { Permission } from '@backstage/plugin-permission-common'; import { JsonObject } from '@backstage/types'; export interface SearchQuery { @@ -76,6 +78,13 @@ export interface DocumentCollator { * index name by Search Engines. */ readonly type: string; + + /** + * The {@link @backstage/plugin-permission-common#Permission} that controls + * visibility of resources associated with this collator's documents. + */ + readonly visibilityPermission?: Permission; + execute(): Promise; }