Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added page dashboards access-control #745

Open
wants to merge 1 commit into
base: next-minor
Choose a base branch
from
Open
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
73 changes: 73 additions & 0 deletions extending-valtimo/dashboard/access-control.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Configuring access control


Before you can use access control with dashboards you need to enable the feature toggle in your `application.yml`.
```
valtimo:
authorization:
dashboard:
enabled: true
```
Without this enabled access control will not work for your dashboards.



## Expanding your existing PBAC autodeployment

For your new dashboards you will need to set up som permissions. For example, you want someone with the role of Admin to be able to see all dashboards.
Then you would expand their role permissions with the following:

```
[
{
"resourceType": "com.ritense.dashboard.domain.Dashboard",
"action": "view",
"roleKey": "ROLE_ADMIN",
"conditions": []
},
{
"resourceType": "com.ritense.dashboard.domain.Dashboard",
"action": "view_list",
"roleKey": "ROLE_ADMIN",
"conditions": []
}
]
```


### Adding conditions

Say for instance that you want someone with a user role to only see 1 of the dashboards you have created, then it would look like the following:

```
[
{
"resourceType": "com.ritense.dashboard.domain.Dashboard",
"action": "view",
"roleKey": "ROLE_USER",
"conditions": [
{
"type": "field",
"field": "key",
"operator": "==",
"value": "loans-dashboard"
}
]
},
{
"resourceType": "com.ritense.dashboard.domain.Dashboard",
"action": "view_list",
"roleKey": "ROLE_USER",
"conditions": [
{
"type": "field",
"field": "key",
"operator": "==",
"value": "loans-dashboard"
}
]
}
]
```

We make sure the value matches the key of the dashboard you've created.
1 change: 1 addition & 0 deletions extending-valtimo/dashboard/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ This section contains instructions and examples on how to extend functionality r
- [Custom data sources](custom-data-source.md)
- [Custom display types](custom-display-type.md)
- [Widget translations](widget-translations.md)
- [Configuring access control](access-control.md)