diff --git a/.changeset/kind-bees-suffer.md b/.changeset/kind-bees-suffer.md index 18e8afa947..bdd6d1f594 100644 --- a/.changeset/kind-bees-suffer.md +++ b/.changeset/kind-bees-suffer.md @@ -1,8 +1,6 @@ --- -'@backstage/plugin-catalog-backend': minor '@backstage/plugin-permission-common': minor '@backstage/plugin-permission-node': minor -'@backstage/plugin-playlist-backend': minor --- **BREAKING**: When defining permission rules, it's now necessary to provide a ZodSchema that specifies the parameters the rule expects. This has been added to help better describe the parameters in the response of the metadata endpoint and to validate the parameters before a rule is executed. diff --git a/.changeset/quick-meals-talk.md b/.changeset/quick-meals-talk.md new file mode 100644 index 0000000000..bde70d25fd --- /dev/null +++ b/.changeset/quick-meals-talk.md @@ -0,0 +1,19 @@ +--- +'@backstage/plugin-playlist-backend': minor +--- + +**BREAKING** Due to the changes made in the Permission framework. The playlist backends permission rules have change to reflect this. + +As an example the `playlistConditions.isOwner` API has changed from + +```ts +playlistConditions.isOwner(['user:default/me', 'group:default/owner']); +``` + +to the new API + +```ts +playlistConditions.isOwner({ + owners: ['user:default/me', 'group:default/owner'], +}); +``` diff --git a/.changeset/seven-panthers-chew.md b/.changeset/seven-panthers-chew.md new file mode 100644 index 0000000000..7b44f2f633 --- /dev/null +++ b/.changeset/seven-panthers-chew.md @@ -0,0 +1,33 @@ +--- +'@backstage/plugin-catalog-backend': minor +--- + +**BREAKING** Due to the changes made in the Permission framework. The catalogs permission rules and the API of `createCatalogPermissionRule` have been changed to reflect the change from individual function parameters to a single object parameter and the addition of the `paramsSchema`. + +As an example for the `hasLabel` rule. The API before the change was + +```ts +hasLabel.apply(entity, 'backstage.io/testLabel'); +hasLabel.toQuery('backstage.io/testLabel'); +``` + +and the API after the change now is + +```ts +hasLabel.apply(entity, { + label: 'backstage.io/testLabel', +}); + +hasLabel.toQuery({ + label: 'backstage.io/testLabel', +}); +``` + +This applies to all of the permission rules exported by the catalog backend. + +- `hasAnnotation` +- `hasLabel` +- `hasMetadata` +- `hasSpec` +- `isEntityKind` +- `isEntityOwner`