Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
a90b3e33
Commit
a90b3e33
authored
Mar 12, 2019
by
Hugo Häggmark
Committed by
Leonard Gram
Mar 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: updated feature toggle name
parent
a6a3d698
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
18 additions
and
19 deletions
+18
-19
conf/defaults.ini
+1
-1
conf/sample.ini
+1
-1
pkg/api/api.go
+1
-1
pkg/api/dashboard.go
+1
-1
pkg/api/dashboard_test.go
+1
-1
pkg/api/folder.go
+1
-1
pkg/api/folder_test.go
+1
-1
pkg/api/frontendsettings.go
+1
-1
pkg/api/index.go
+1
-1
pkg/api/team.go
+1
-1
pkg/setting/setting.go
+3
-4
public/app/core/config.ts
+2
-2
public/app/features/teams/TeamMembers.tsx
+2
-2
public/app/routes/routes.ts
+1
-1
No files found.
conf/defaults.ini
View file @
a90b3e33
...
@@ -259,7 +259,7 @@ external_manage_info =
...
@@ -259,7 +259,7 @@ external_manage_info =
viewers_can_edit
=
false
viewers_can_edit
=
false
# Editors can administrate dashboard, folders and teams they create
# Editors can administrate dashboard, folders and teams they create
editors_can_
ow
n
=
false
editors_can_
admi
n
=
false
[auth]
[auth]
# Login cookie name
# Login cookie name
...
...
conf/sample.ini
View file @
a90b3e33
...
@@ -239,7 +239,7 @@ log_queries =
...
@@ -239,7 +239,7 @@ log_queries =
;viewers_can_edit = false
;viewers_can_edit = false
# Editors can administrate dashboard, folders and teams they create
# Editors can administrate dashboard, folders and teams they create
;editors_can_
ow
n = false
;editors_can_
admi
n = false
[auth]
[auth]
# Login cookie name
# Login cookie name
...
...
pkg/api/api.go
View file @
a90b3e33
...
@@ -14,7 +14,7 @@ func (hs *HTTPServer) registerRoutes() {
...
@@ -14,7 +14,7 @@ func (hs *HTTPServer) registerRoutes() {
reqGrafanaAdmin
:=
middleware
.
ReqGrafanaAdmin
reqGrafanaAdmin
:=
middleware
.
ReqGrafanaAdmin
reqEditorRole
:=
middleware
.
ReqEditorRole
reqEditorRole
:=
middleware
.
ReqEditorRole
reqOrgAdmin
:=
middleware
.
ReqOrgAdmin
reqOrgAdmin
:=
middleware
.
ReqOrgAdmin
reqAdminOrEditorCanAdmin
:=
middleware
.
EditorCanAdmin
(
hs
.
Cfg
.
EditorsCan
Ow
n
)
reqAdminOrEditorCanAdmin
:=
middleware
.
EditorCanAdmin
(
hs
.
Cfg
.
EditorsCan
Admi
n
)
redirectFromLegacyDashboardURL
:=
middleware
.
RedirectFromLegacyDashboardURL
()
redirectFromLegacyDashboardURL
:=
middleware
.
RedirectFromLegacyDashboardURL
()
redirectFromLegacyDashboardSoloURL
:=
middleware
.
RedirectFromLegacyDashboardSoloURL
()
redirectFromLegacyDashboardSoloURL
:=
middleware
.
RedirectFromLegacyDashboardSoloURL
()
quota
:=
middleware
.
Quota
(
hs
.
QuotaService
)
quota
:=
middleware
.
Quota
(
hs
.
QuotaService
)
...
...
pkg/api/dashboard.go
View file @
a90b3e33
...
@@ -277,7 +277,7 @@ func (hs *HTTPServer) PostDashboard(c *m.ReqContext, cmd m.SaveDashboardCommand)
...
@@ -277,7 +277,7 @@ func (hs *HTTPServer) PostDashboard(c *m.ReqContext, cmd m.SaveDashboardCommand)
return
Error
(
500
,
"Failed to save dashboard"
,
err
)
return
Error
(
500
,
"Failed to save dashboard"
,
err
)
}
}
if
hs
.
Cfg
.
EditorsCan
Ow
n
&&
newDashboard
{
if
hs
.
Cfg
.
EditorsCan
Admi
n
&&
newDashboard
{
aclService
:=
dashboards
.
NewAclService
()
aclService
:=
dashboards
.
NewAclService
()
inFolder
:=
cmd
.
FolderId
>
0
inFolder
:=
cmd
.
FolderId
>
0
err
:=
aclService
.
MakeUserAdmin
(
cmd
.
OrgId
,
cmd
.
UserId
,
dashboard
.
Id
,
!
inFolder
)
err
:=
aclService
.
MakeUserAdmin
(
cmd
.
OrgId
,
cmd
.
UserId
,
dashboard
.
Id
,
!
inFolder
)
...
...
pkg/api/dashboard_test.go
View file @
a90b3e33
...
@@ -973,7 +973,7 @@ func postDashboardScenario(desc string, url string, routePattern string, mock *d
...
@@ -973,7 +973,7 @@ func postDashboardScenario(desc string, url string, routePattern string, mock *d
defer
bus
.
ClearBusHandlers
()
defer
bus
.
ClearBusHandlers
()
cfg
:=
setting
.
NewCfg
()
cfg
:=
setting
.
NewCfg
()
cfg
.
EditorsCan
Ow
n
=
false
cfg
.
EditorsCan
Admi
n
=
false
hs
:=
HTTPServer
{
hs
:=
HTTPServer
{
Bus
:
bus
.
GetBus
(),
Bus
:
bus
.
GetBus
(),
...
...
pkg/api/folder.go
View file @
a90b3e33
...
@@ -61,7 +61,7 @@ func (hs *HTTPServer) CreateFolder(c *m.ReqContext, cmd m.CreateFolderCommand) R
...
@@ -61,7 +61,7 @@ func (hs *HTTPServer) CreateFolder(c *m.ReqContext, cmd m.CreateFolderCommand) R
return
toFolderError
(
err
)
return
toFolderError
(
err
)
}
}
if
hs
.
Cfg
.
EditorsCan
Ow
n
{
if
hs
.
Cfg
.
EditorsCan
Admi
n
{
aclService
:=
dashboards
.
NewAclService
()
aclService
:=
dashboards
.
NewAclService
()
if
err
:=
aclService
.
MakeUserAdmin
(
c
.
OrgId
,
c
.
SignedInUser
.
UserId
,
cmd
.
Result
.
Id
,
true
);
err
!=
nil
{
if
err
:=
aclService
.
MakeUserAdmin
(
c
.
OrgId
,
c
.
SignedInUser
.
UserId
,
cmd
.
Result
.
Id
,
true
);
err
!=
nil
{
hs
.
log
.
Error
(
"Could not make user admin"
,
"folder"
,
cmd
.
Result
.
Title
,
"user"
,
c
.
SignedInUser
.
UserId
,
"error"
,
err
)
hs
.
log
.
Error
(
"Could not make user admin"
,
"folder"
,
cmd
.
Result
.
Title
,
"user"
,
c
.
SignedInUser
.
UserId
,
"error"
,
err
)
...
...
pkg/api/folder_test.go
View file @
a90b3e33
...
@@ -143,7 +143,7 @@ func createFolderScenario(desc string, url string, routePattern string, mock *fa
...
@@ -143,7 +143,7 @@ func createFolderScenario(desc string, url string, routePattern string, mock *fa
defer
bus
.
ClearBusHandlers
()
defer
bus
.
ClearBusHandlers
()
cfg
:=
setting
.
NewCfg
()
cfg
:=
setting
.
NewCfg
()
cfg
.
EditorsCan
Ow
n
=
true
cfg
.
EditorsCan
Admi
n
=
true
hs
:=
HTTPServer
{
hs
:=
HTTPServer
{
Bus
:
bus
.
GetBus
(),
Bus
:
bus
.
GetBus
(),
...
...
pkg/api/frontendsettings.go
View file @
a90b3e33
...
@@ -167,7 +167,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
...
@@ -167,7 +167,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
"externalUserMngLinkUrl"
:
setting
.
ExternalUserMngLinkUrl
,
"externalUserMngLinkUrl"
:
setting
.
ExternalUserMngLinkUrl
,
"externalUserMngLinkName"
:
setting
.
ExternalUserMngLinkName
,
"externalUserMngLinkName"
:
setting
.
ExternalUserMngLinkName
,
"viewersCanEdit"
:
setting
.
ViewersCanEdit
,
"viewersCanEdit"
:
setting
.
ViewersCanEdit
,
"editorsCan
Own"
:
hs
.
Cfg
.
EditorsCanOw
n
,
"editorsCan
Admin"
:
hs
.
Cfg
.
EditorsCanAdmi
n
,
"disableSanitizeHtml"
:
hs
.
Cfg
.
DisableSanitizeHtml
,
"disableSanitizeHtml"
:
hs
.
Cfg
.
DisableSanitizeHtml
,
"buildInfo"
:
map
[
string
]
interface
{}{
"buildInfo"
:
map
[
string
]
interface
{}{
"version"
:
setting
.
BuildVersion
,
"version"
:
setting
.
BuildVersion
,
...
...
pkg/api/index.go
View file @
a90b3e33
...
@@ -327,7 +327,7 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er
...
@@ -327,7 +327,7 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er
})
})
}
}
if
c
.
OrgRole
==
m
.
ROLE_EDITOR
&&
hs
.
Cfg
.
EditorsCan
Ow
n
{
if
c
.
OrgRole
==
m
.
ROLE_EDITOR
&&
hs
.
Cfg
.
EditorsCan
Admi
n
{
cfgNode
:=
&
dtos
.
NavLink
{
cfgNode
:=
&
dtos
.
NavLink
{
Id
:
"cfg"
,
Id
:
"cfg"
,
Text
:
"Configuration"
,
Text
:
"Configuration"
,
...
...
pkg/api/team.go
View file @
a90b3e33
...
@@ -18,7 +18,7 @@ func (hs *HTTPServer) CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Respo
...
@@ -18,7 +18,7 @@ func (hs *HTTPServer) CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Respo
return
Error
(
500
,
"Failed to create Team"
,
err
)
return
Error
(
500
,
"Failed to create Team"
,
err
)
}
}
if
c
.
OrgRole
==
m
.
ROLE_EDITOR
&&
hs
.
Cfg
.
EditorsCan
Ow
n
{
if
c
.
OrgRole
==
m
.
ROLE_EDITOR
&&
hs
.
Cfg
.
EditorsCan
Admi
n
{
addMemberCmd
:=
m
.
AddTeamMemberCommand
{
addMemberCmd
:=
m
.
AddTeamMemberCommand
{
UserId
:
c
.
SignedInUser
.
UserId
,
UserId
:
c
.
SignedInUser
.
UserId
,
OrgId
:
cmd
.
OrgId
,
OrgId
:
cmd
.
OrgId
,
...
...
pkg/setting/setting.go
View file @
a90b3e33
...
@@ -239,14 +239,13 @@ type Cfg struct {
...
@@ -239,14 +239,13 @@ type Cfg struct {
LoginMaxLifetimeDays
int
LoginMaxLifetimeDays
int
TokenRotationIntervalMinutes
int
TokenRotationIntervalMinutes
int
// User
EditorsCanOwn
bool
// Dataproxy
// Dataproxy
SendUserHeader
bool
SendUserHeader
bool
// DistributedCache
// DistributedCache
RemoteCacheOptions
*
RemoteCacheOptions
RemoteCacheOptions
*
RemoteCacheOptions
EditorsCanAdmin
bool
}
}
type
CommandLineArgs
struct
{
type
CommandLineArgs
struct
{
...
@@ -670,7 +669,7 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
...
@@ -670,7 +669,7 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
ExternalUserMngLinkName
=
users
.
Key
(
"external_manage_link_name"
)
.
String
()
ExternalUserMngLinkName
=
users
.
Key
(
"external_manage_link_name"
)
.
String
()
ExternalUserMngInfo
=
users
.
Key
(
"external_manage_info"
)
.
String
()
ExternalUserMngInfo
=
users
.
Key
(
"external_manage_info"
)
.
String
()
ViewersCanEdit
=
users
.
Key
(
"viewers_can_edit"
)
.
MustBool
(
false
)
ViewersCanEdit
=
users
.
Key
(
"viewers_can_edit"
)
.
MustBool
(
false
)
cfg
.
EditorsCan
Own
=
users
.
Key
(
"editors_can_ow
n"
)
.
MustBool
(
false
)
cfg
.
EditorsCan
Admin
=
users
.
Key
(
"editors_can_admi
n"
)
.
MustBool
(
false
)
// auth
// auth
auth
:=
iniFile
.
Section
(
"auth"
)
auth
:=
iniFile
.
Section
(
"auth"
)
...
...
public/app/core/config.ts
View file @
a90b3e33
...
@@ -37,7 +37,7 @@ export class Settings {
...
@@ -37,7 +37,7 @@ export class Settings {
passwordHint
:
any
;
passwordHint
:
any
;
loginError
:
any
;
loginError
:
any
;
viewersCanEdit
:
boolean
;
viewersCanEdit
:
boolean
;
editorsCan
Ow
n
:
boolean
;
editorsCan
Admi
n
:
boolean
;
disableSanitizeHtml
:
boolean
;
disableSanitizeHtml
:
boolean
;
theme
:
GrafanaTheme
;
theme
:
GrafanaTheme
;
...
@@ -59,7 +59,7 @@ export class Settings {
...
@@ -59,7 +59,7 @@ export class Settings {
isEnterprise
:
false
,
isEnterprise
:
false
,
},
},
viewersCanEdit
:
false
,
viewersCanEdit
:
false
,
editorsCan
Ow
n
:
false
,
editorsCan
Admi
n
:
false
,
disableSanitizeHtml
:
false
,
disableSanitizeHtml
:
false
,
};
};
...
...
public/app/features/teams/TeamMembers.tsx
View file @
a90b3e33
...
@@ -93,7 +93,7 @@ export class TeamMembers extends PureComponent<Props, State> {
...
@@ -93,7 +93,7 @@ export class TeamMembers extends PureComponent<Props, State> {
</
td
>
</
td
>
<
td
>
{
member
.
login
}
</
td
>
<
td
>
{
member
.
login
}
</
td
>
<
td
>
{
member
.
email
}
</
td
>
<
td
>
{
member
.
email
}
</
td
>
<
WithFeatureToggle
featureToggle=
{
config
.
editorsCan
Ow
n
}
>
<
WithFeatureToggle
featureToggle=
{
config
.
editorsCan
Admi
n
}
>
<
td
>
<
td
>
<
div
className=
"gf-form"
>
<
div
className=
"gf-form"
>
<
Select
<
Select
...
@@ -161,7 +161,7 @@ export class TeamMembers extends PureComponent<Props, State> {
...
@@ -161,7 +161,7 @@ export class TeamMembers extends PureComponent<Props, State> {
<
th
/>
<
th
/>
<
th
>
Name
</
th
>
<
th
>
Name
</
th
>
<
th
>
Email
</
th
>
<
th
>
Email
</
th
>
<
WithFeatureToggle
featureToggle=
{
config
.
editorsCan
Ow
n
}
>
<
WithFeatureToggle
featureToggle=
{
config
.
editorsCan
Admi
n
}
>
<
th
>
Permission
</
th
>
<
th
>
Permission
</
th
>
</
WithFeatureToggle
>
</
WithFeatureToggle
>
{
syncEnabled
&&
<
th
/>
}
{
syncEnabled
&&
<
th
/>
}
...
...
public/app/routes/routes.ts
View file @
a90b3e33
...
@@ -207,7 +207,7 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
...
@@ -207,7 +207,7 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
.
when
(
'/org/teams/edit/:id/:page?'
,
{
.
when
(
'/org/teams/edit/:id/:page?'
,
{
template
:
'<react-container />'
,
template
:
'<react-container />'
,
resolve
:
{
resolve
:
{
roles
:
()
=>
(
config
.
editorsCan
Ow
n
?
[
'Editor'
,
'Admin'
]
:
[
'Admin'
]),
roles
:
()
=>
(
config
.
editorsCan
Admi
n
?
[
'Editor'
,
'Admin'
]
:
[
'Admin'
]),
component
:
()
=>
TeamPages
,
component
:
()
=>
TeamPages
,
},
},
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment