Skip to content

Commit d80259e

Browse files
feat(realm): add rbac support for banners (#20782)
Co-authored-by: Adam Altman <adam@redocly.com> remoteId: rem_01jwbtfqhbbam07z9j9m0etng6 remoteUpdateId: grupd_01kh1e1hwpb8ncfzt9hdpqt2sj branchName: main commitSha: 053051e82f8cea1b5a0a9ff537d93a114febbe16 commitUrl: Redocly/redocly@053051e
1 parent c255f97 commit d80259e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/realm/config/banner.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ If you ejected the `navbar` component before version `0.128.0`, [update it](../c
9595
- `error` - Red background
9696
Default: `info`
9797

98+
---
99+
100+
- rbac
101+
- object
102+
- Map of teams to permission levels that determines who can see the banner.
103+
Controls the visibility of the banner based on the user's team membership.
104+
If specified, only users belonging to teams with at least `read` access will see the banner.
105+
For more information, see [RBAC configuration](./rbac.md).
98106
{% /table %}
99107

100108
## Configuration
@@ -126,6 +134,22 @@ banner:
126134
dismissible: true
127135
target: '**'
128136
```
137+
138+
### Role-based visibility
139+
140+
Control banner visibility based on team membership:
141+
142+
```yaml {% title="redocly.yaml" %}
143+
banner:
144+
- content: "🔒 Please log in to see all content!"
145+
color: warning
146+
rbac:
147+
anonymous: read
148+
authenticated: none
149+
```
150+
151+
In this example, the banner is only visible to unauthenticated visitors (`anonymous` team).
152+
129153
Configure a banner in the front matter of a specific page:
130154
```md {% title="example.md" %}
131155
---

0 commit comments

Comments
 (0)