Skip to content

Commit 0e5d763

Browse files
Access Control: Make it possible to exclude role grants (grafana#91647)
1 parent 89ee970 commit 0e5d763

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/api/accesscontrol.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ func (hs *HTTPServer) declareFixedRoles() error {
442442
},
443443
},
444444
Grants: []string{"Editor"},
445+
// Don't grant fixed:folders:creator to Admin
446+
Exclude: []string{"Admin"},
445447
}
446448

447449
foldersReaderRole := ac.RoleRegistration{

pkg/services/accesscontrol/models.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ var (
2626
// RoleRegistration stores a role and its assignments to built-in roles
2727
// (Viewer, Editor, Admin, Grafana Admin)
2828
type RoleRegistration struct {
29-
Role RoleDTO
30-
Grants []string
29+
Role RoleDTO
30+
Grants []string
31+
Exclude []string
3132
}
3233

3334
// Role is the model for Role in RBAC.

0 commit comments

Comments
 (0)