mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 00:08:10 -05:00
dashboard acl
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
|||||||
type PermissionType int
|
type PermissionType int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PERMISSION_NONE = 0
|
|
||||||
PERMISSION_VIEW PermissionType = 1 << iota
|
PERMISSION_VIEW PermissionType = 1 << iota
|
||||||
PERMISSION_EDIT
|
PERMISSION_EDIT
|
||||||
PERMISSION_ADMIN
|
PERMISSION_ADMIN
|
||||||
@@ -16,7 +15,6 @@ const (
|
|||||||
|
|
||||||
func (p PermissionType) String() string {
|
func (p PermissionType) String() string {
|
||||||
names := map[int]string{
|
names := map[int]string{
|
||||||
int(PERMISSION_NONE): "None",
|
|
||||||
int(PERMISSION_VIEW): "View",
|
int(PERMISSION_VIEW): "View",
|
||||||
int(PERMISSION_EDIT): "Edit",
|
int(PERMISSION_EDIT): "Edit",
|
||||||
int(PERMISSION_ADMIN): "Admin",
|
int(PERMISSION_ADMIN): "Admin",
|
||||||
|
|||||||
@@ -35,13 +35,14 @@ INSERT INTO dashboard_acl
|
|||||||
(
|
(
|
||||||
org_id,
|
org_id,
|
||||||
dashboard_id,
|
dashboard_id,
|
||||||
|
permission,
|
||||||
role,
|
role,
|
||||||
created,
|
created,
|
||||||
updated
|
updated
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES
|
||||||
(-1,-1,'Viewer','2017-06-20','2017-06-20'),
|
(-1,-1, 1,'Viewer','2017-06-20','2017-06-20'),
|
||||||
(-1,-1,'Editor','2017-06-20','2017-06-20')
|
(-1,-1, 2,'Editor','2017-06-20','2017-06-20')
|
||||||
`
|
`
|
||||||
|
|
||||||
mg.AddMigration("save default acl rules in dashboard_acl table", new(RawSqlMigration).
|
mg.AddMigration("save default acl rules in dashboard_acl table", new(RawSqlMigration).
|
||||||
|
|||||||
Reference in New Issue
Block a user