catalog-common: add CatalogEntityPermission convenience type
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
committed by
Joe Porpeglia
parent
6a8c4251a1
commit
8c8bee47f4
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-common': patch
|
||||
---
|
||||
|
||||
Add `CatalogEntityPermission` convenience type.
|
||||
@@ -29,6 +29,11 @@ export interface CatalogEntityDocument extends IndexableDocument {
|
||||
type: string;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export type CatalogEntityPermission = ResourcePermission<
|
||||
typeof RESOURCE_TYPE_CATALOG_ENTITY
|
||||
>;
|
||||
|
||||
// @alpha
|
||||
export const catalogEntityReadPermission: ResourcePermission<'catalog-entity'>;
|
||||
|
||||
|
||||
@@ -31,5 +31,6 @@ export {
|
||||
catalogLocationCreatePermission,
|
||||
catalogLocationDeletePermission,
|
||||
} from './permissions';
|
||||
export type { CatalogEntityPermission } from './permissions';
|
||||
|
||||
export * from './search';
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createPermission } from '@backstage/plugin-permission-common';
|
||||
import {
|
||||
createPermission,
|
||||
ResourcePermission,
|
||||
} from '@backstage/plugin-permission-common';
|
||||
|
||||
/**
|
||||
* Permission resource type which corresponds to catalog entities.
|
||||
@@ -24,6 +27,15 @@ import { createPermission } from '@backstage/plugin-permission-common';
|
||||
*/
|
||||
export const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';
|
||||
|
||||
/**
|
||||
* Convenience type for catalog entity
|
||||
* {@link @backstage/plugin-permission-common#ResourcePermission}s.
|
||||
* @alpha
|
||||
*/
|
||||
export type CatalogEntityPermission = ResourcePermission<
|
||||
typeof RESOURCE_TYPE_CATALOG_ENTITY
|
||||
>;
|
||||
|
||||
/**
|
||||
* This permission is used to authorize actions that involve reading one or more
|
||||
* entities from the catalog.
|
||||
|
||||
Reference in New Issue
Block a user