Backstage permissions
Keep authentication and authorization separate and enforce permissions in backend data access, not only in the UI.
When to invoke
- "Add permissions to this Backstage plugin."
- "Write an RBAC or ABAC policy."
- "Implement conditional resource filtering."
- "Hide and deny unauthorized frontend or backend actions."
Procedure
- Confirm identity is established and inventory the action or resource being protected.
- Choose a basic permission when the decision is action-wide, or a resource permission when the decision depends on resource attributes.
- Put shared permission definitions in a common package consumable by backend, frontend, and policy code.
- For resource permissions, define a resource reference, rules,
apply, andtoQuery. - Keep
applyandtoQuerylogically equivalent. - Register permissions and resource types through the permissions registry.
- Authenticate the request, authorize with credentials, and apply conditional filters in the data layer before loading or returning resources.
- Add frontend permission checks for experience, but do not rely on them for enforcement.
- Test allow, deny, conditional, missing resource, unauthenticated, and pagination behavior.
- Document policy ownership and how adopters can compose exported condition helpers.
Security criteria
- Backstage endpoints are not automatically protected merely because a sign-in page exists.
- Denied backend access must fail even when the frontend control is bypassed.
- Conditional filtering must occur before pagination so unauthorized resources do not distort result counts or leak through.
Output template
## Backstage permission result
| Permission | Type | Resource | Enforcement | Policy test |
| --- | --- | --- | --- | --- |
### Conditions
- Rule:
- `apply` / `toQuery` equivalence:
Quality gate
- Authentication and authorization are treated separately.
- Permission definitions live in a reusable package.
- Backend enforcement cannot be bypassed through the frontend.
- Resource rules produce equivalent in-memory and query decisions.
- Conditional filtering and pagination do not leak unauthorized resources.
- Allow, deny, conditional, and unauthenticated tests pass.