Revert "Revert "AccessControl: Implement a way to register fixed roles (#35641)" (#37397)" (#37535)

This reverts commit 55efeb0c02.
This commit is contained in:
Jeremy Price
2021-08-04 14:44:37 +02:00
committed by GitHub
parent 7fd94e69c3
commit e8e1a0b50b
14 changed files with 954 additions and 232 deletions
+11 -9
View File
@@ -4,6 +4,13 @@ import (
"time"
)
// RoleRegistration stores a role and its assignments to built-in roles
// (Viewer, Editor, Admin, Grafana Admin)
type RoleRegistration struct {
Role RoleDTO
Grants []string
}
type Role struct {
Version int64 `json:"version"`
UID string `json:"uid"`
@@ -42,9 +49,6 @@ func (p RoleDTO) Role() Role {
const (
// Permission actions
// Provisioning actions
ActionProvisioningReload = "provisioning:reload"
// Users actions
ActionUsersRead = "users:read"
ActionUsersWrite = "users:write"
@@ -94,15 +98,13 @@ const (
// Global Scopes
ScopeGlobalUsersAll = "global:users:*"
// Users scopes
ScopeUsersSelf = "users:self"
ScopeUsersAll = "users:*"
// Users scope
ScopeUsersAll = "users:*"
// Settings scope
ScopeSettingsAll = "settings:**"
// Services Scopes
ScopeServicesAll = "service:*"
)
const RoleGrafanaAdmin = "Grafana Admin"
const FixedRolePrefix = "fixed:"