From e3c2bfef11b268981627d1ffebfcd513549ecac6 Mon Sep 17 00:00:00 2001 From: Mike Lewis Date: Tue, 1 Mar 2022 13:35:41 +0000 Subject: [PATCH] catalog-common: remove resourceType from catalogEntityCreatePermission The resourceType on permissions refers to the resource whose ref is expected to be passed along with the permission during authorization. This allows the permission-backend to make the decision based on characteristics of the resource. Since the entity being created by definition doesn't yet exist, it's not correct for this permission to include a resourceType. Signed-off-by: Mike Lewis --- .changeset/giant-taxis-drop.md | 5 +++++ plugins/catalog-common/src/permissions.ts | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .changeset/giant-taxis-drop.md diff --git a/.changeset/giant-taxis-drop.md b/.changeset/giant-taxis-drop.md new file mode 100644 index 0000000000..41f8a91d40 --- /dev/null +++ b/.changeset/giant-taxis-drop.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-common': minor +--- + +Remove resourceType property from catalogEntityCreatePermission. Resource type refers to the type of resources whose resourceRefs should be passed along with authorize requests, to allow conditional responses for that resource type. Since creation does not correspond to an entity (as the entity does not exist at the time of authorization), the resourceRef should not be included on the permission. diff --git a/plugins/catalog-common/src/permissions.ts b/plugins/catalog-common/src/permissions.ts index 52c225e441..51b09bab7e 100644 --- a/plugins/catalog-common/src/permissions.ts +++ b/plugins/catalog-common/src/permissions.ts @@ -49,7 +49,6 @@ export const catalogEntityCreatePermission: Permission = { attributes: { action: 'create', }, - resourceType: RESOURCE_TYPE_CATALOG_ENTITY, }; /**