Merge pull request #24706 from AmbrishRamachandiran/resource-permission-check

Updated document of resource permission check
This commit is contained in:
Fredrik Adelöw
2024-05-14 07:53:46 +02:00
committed by GitHub
@@ -144,7 +144,11 @@ export const rules = { isOwner };
`makeCreatePermissionRule` is a helper used to ensure that rules created for this plugin use consistent types for the resource and query.
> Note: To support custom rules defined by Backstage integrators, you must export `createTodoListPermissionRule` from the backend package and provide some way for custom rules to be passed in before the backend starts, likely via `createRouter`.
:::note Note
To support custom rules defined by Backstage integrators, you must export `createTodoListPermissionRule` from the backend package and provide some way for custom rules to be passed in before the backend starts, likely via `createRouter`.
:::
We have created a new `isOwner` rule, which is going to be automatically used by the permission framework whenever a conditional response is returned in response to an authorized request with an attached `resourceRef`.
Specifically, the `apply` function is used to understand whether the passed resource should be authorized or not.