search-common: add optional visibilityPermission property to DocumentCollator type

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2022-01-17 17:57:09 +00:00
parent 96cbebc629
commit 9a511968b1
4 changed files with 18 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/search-common': patch
---
Add optional visibilityPermission property to DocumentCollator type
+2
View File
@@ -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<IndexableDocument[]>;
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)
+2 -1
View File
@@ -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"
+9
View File
@@ -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<IndexableDocument[]>;
}