Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/_data/sidebars/help.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ resources:
link: /specification-support/extensions/
- label: Badges
link: /specification-support/doc-badges/
- label: Roles requirements
link: /specification-support/roles-requirements/
- label: Custom meta tags
link: /specification-support/meta-tags/
- label: OpenAPI support
Expand Down
6 changes: 5 additions & 1 deletion src/_help/specification-support/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ This custom property lets you add custom meta tags in the `<head>` tag of your d

## Change tags display name (`x-displayName`)

This custom property lets you change the display name of your OpenAPI tags. Find out more in our [dedicated section](/help/specification-support/openapi-support/x-display-name).
This custom property lets you change the display name of your OpenAPI tags. Find out more in our [dedicated section](/help/specification-support/openapi-support/x-display-name).

## Define role requirements (`x-rolesRequirements`)

This custom property specifies which roles or permissions are required to access an endpoint. Find out more in our [dedicated section](/help/specification-support/roles-requirements).
44 changes: 44 additions & 0 deletions src/_help/specification-support/roles-requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Role requirements
---

- TOC
{:toc}

Specify which roles or permissions are required to access an API endpoint with `x-rolesRequirements`. Combined with security schemes, this extension helps your API users understand both **what authentication method** they need and **what access levels or roles** their credentials must have.

Add the `x-rolesRequirements` property to any OpenAPI/AsyncAPI operation or OpenAPI webhook. The property accepts either a string or an array of strings.

### Example usage

#### Using an array of strings

```yaml
paths:
/clusters:
post:
summary: Create a new cluster
x-rolesRequirements:
- Organization owner
- Product owner
# ... rest of operation
```

![Screenshot of an example API documentation on Bump.sh, with a multilines roles requirements area.](/docs/images/help/roles-requirements-multilines.png)

#### Using a single string

```yaml
paths:
/clusters/{id}:
get:
summary: Get cluster details
x-rolesRequirements: "Cluster privileges: read"
# ... rest of operation
```

![Screenshot of an example API documentation on Bump.sh, with a single line roles requirements area.](/docs/images/help/roles-requirements-single-line.png)

### Impact on the changelog

Roles requirements updates are not visible in the changelog.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading