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
d593ffe3
Commit
d593ffe3
authored
Mar 11, 2019
by
Leonard Gram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboards: better error handling
parent
89d4db8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
pkg/api/dashboard.go
+2
-1
pkg/api/folder.go
+4
-1
No files found.
pkg/api/dashboard.go
View file @
d593ffe3
...
...
@@ -281,7 +281,8 @@ func (hs *HTTPServer) PostDashboard(c *m.ReqContext, cmd m.SaveDashboardCommand)
aclService
:=
dashboards
.
NewAclService
()
err
:=
aclService
.
MakeUserAdmin
(
cmd
.
OrgId
,
cmd
.
UserId
,
dashboard
.
Id
)
if
err
!=
nil
{
hs
.
log
.
Error
(
"Could not make user admin"
,
"error"
,
err
)
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 @
d593ffe3
...
...
@@ -63,7 +63,10 @@ func (hs *HTTPServer) CreateFolder(c *m.ReqContext, cmd m.CreateFolderCommand) R
if
hs
.
Cfg
.
EditorsCanOwn
{
aclService
:=
dashboards
.
NewAclService
()
aclService
.
MakeUserAdmin
(
c
.
OrgId
,
c
.
SignedInUser
.
UserId
,
cmd
.
Result
.
Id
)
if
err
:=
aclService
.
MakeUserAdmin
(
c
.
OrgId
,
c
.
SignedInUser
.
UserId
,
cmd
.
Result
.
Id
);
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
)
}
}
g
:=
guardian
.
New
(
cmd
.
Result
.
Id
,
c
.
OrgId
,
c
.
SignedInUser
)
...
...
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