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
a615b78f
Commit
a615b78f
authored
Mar 14, 2019
by
Leonard Gram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
permissions: removes global access to bus from MakeUserAdmin.
parent
adf0390b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
pkg/api/dashboard.go
+1
-1
pkg/api/folder.go
+1
-1
pkg/api/team.go
+2
-2
pkg/services/dashboards/acl_service.go
+1
-1
No files found.
pkg/api/dashboard.go
View file @
a615b78f
...
...
@@ -279,7 +279,7 @@ func (hs *HTTPServer) PostDashboard(c *m.ReqContext, cmd m.SaveDashboardCommand)
if
hs
.
Cfg
.
EditorsCanAdmin
&&
newDashboard
{
inFolder
:=
cmd
.
FolderId
>
0
err
:=
dashboards
.
MakeUserAdmin
(
cmd
.
OrgId
,
cmd
.
UserId
,
dashboard
.
Id
,
!
inFolder
)
err
:=
dashboards
.
MakeUserAdmin
(
hs
.
Bus
,
cmd
.
OrgId
,
cmd
.
UserId
,
dashboard
.
Id
,
!
inFolder
)
if
err
!=
nil
{
hs
.
log
.
Error
(
"Could not make user admin"
,
"dashboard"
,
cmd
.
Result
.
Title
,
"user"
,
c
.
SignedInUser
.
UserId
,
"error"
,
err
)
return
Error
(
500
,
"Failed to make user admin of dashboard"
,
err
)
...
...
pkg/api/folder.go
View file @
a615b78f
...
...
@@ -62,7 +62,7 @@ func (hs *HTTPServer) CreateFolder(c *m.ReqContext, cmd m.CreateFolderCommand) R
}
if
hs
.
Cfg
.
EditorsCanAdmin
{
if
err
:=
dashboards
.
MakeUserAdmin
(
c
.
OrgId
,
c
.
SignedInUser
.
UserId
,
cmd
.
Result
.
Id
,
true
);
err
!=
nil
{
if
err
:=
dashboards
.
MakeUserAdmin
(
hs
.
Bus
,
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
)
return
Error
(
500
,
"Failed to make user admin of folder"
,
err
)
}
...
...
pkg/api/team.go
View file @
a615b78f
...
...
@@ -16,7 +16,7 @@ func (hs *HTTPServer) CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Respo
return
Error
(
403
,
"Not allowed to create team."
,
nil
)
}
if
err
:=
b
us
.
Dispatch
(
&
cmd
);
err
!=
nil
{
if
err
:=
hs
.
B
us
.
Dispatch
(
&
cmd
);
err
!=
nil
{
if
err
==
m
.
ErrTeamNameTaken
{
return
Error
(
409
,
"Team name taken"
,
err
)
}
...
...
@@ -31,7 +31,7 @@ func (hs *HTTPServer) CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Respo
Permission
:
m
.
PERMISSION_ADMIN
,
}
if
err
:=
b
us
.
Dispatch
(
&
addMemberCmd
);
err
!=
nil
{
if
err
:=
hs
.
B
us
.
Dispatch
(
&
addMemberCmd
);
err
!=
nil
{
c
.
Logger
.
Error
(
"Could not add creator to team."
,
"error"
,
err
)
}
}
...
...
pkg/services/dashboards/acl_service.go
View file @
a615b78f
...
...
@@ -6,7 +6,7 @@ import (
"time"
)
func
MakeUserAdmin
(
orgId
int64
,
userId
int64
,
dashboardId
int64
,
setViewAndEditPermissions
bool
)
error
{
func
MakeUserAdmin
(
bus
bus
.
Bus
,
orgId
int64
,
userId
int64
,
dashboardId
int64
,
setViewAndEditPermissions
bool
)
error
{
rtEditor
:=
models
.
ROLE_EDITOR
rtViewer
:=
models
.
ROLE_VIEWER
...
...
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