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
61ed0b03
Commit
61ed0b03
authored
Dec 20, 2017
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashfolders: remove role requirements on dashboard routes
and rely on the permission system instead.
parent
f7bbfeba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
pkg/api/api.go
+3
-3
pkg/api/dashboard.go
+2
-2
No files found.
pkg/api/api.go
View file @
61ed0b03
...
...
@@ -243,11 +243,11 @@ func (hs *HttpServer) registerRoutes() {
// Dashboard
apiRoute
.
Group
(
"/dashboards"
,
func
(
dashboardRoute
RouteRegister
)
{
dashboardRoute
.
Get
(
"/db/:slug"
,
wrap
(
GetDashboard
))
dashboardRoute
.
Delete
(
"/db/:slug"
,
reqEditorRole
,
wrap
(
DeleteDashboard
))
dashboardRoute
.
Delete
(
"/db/:slug"
,
wrap
(
DeleteDashboard
))
dashboardRoute
.
Post
(
"/calculate-diff"
,
bind
(
dtos
.
CalculateDiffOptions
{}),
wrap
(
CalculateDashboardDiff
))
dashboardRoute
.
Post
(
"/db"
,
reqEditorRole
,
bind
(
m
.
SaveDashboardCommand
{}),
wrap
(
PostDashboard
))
dashboardRoute
.
Post
(
"/db"
,
bind
(
m
.
SaveDashboardCommand
{}),
wrap
(
PostDashboard
))
dashboardRoute
.
Get
(
"/home"
,
wrap
(
GetHomeDashboard
))
dashboardRoute
.
Get
(
"/tags"
,
GetDashboardTags
)
dashboardRoute
.
Post
(
"/import"
,
bind
(
dtos
.
ImportDashboardCommand
{}),
wrap
(
ImportDashboard
))
...
...
@@ -255,7 +255,7 @@ func (hs *HttpServer) registerRoutes() {
dashboardRoute
.
Group
(
"/id/:dashboardId"
,
func
(
dashIdRoute
RouteRegister
)
{
dashIdRoute
.
Get
(
"/versions"
,
wrap
(
GetDashboardVersions
))
dashIdRoute
.
Get
(
"/versions/:id"
,
wrap
(
GetDashboardVersion
))
dashIdRoute
.
Post
(
"/restore"
,
reqEditorRole
,
bind
(
dtos
.
RestoreDashboardVersionCommand
{}),
wrap
(
RestoreDashboardVersion
))
dashIdRoute
.
Post
(
"/restore"
,
bind
(
dtos
.
RestoreDashboardVersionCommand
{}),
wrap
(
RestoreDashboardVersion
))
dashIdRoute
.
Group
(
"/acl"
,
func
(
aclRoute
RouteRegister
)
{
aclRoute
.
Get
(
"/"
,
wrap
(
GetDashboardAclList
))
...
...
pkg/api/dashboard.go
View file @
61ed0b03
...
...
@@ -38,9 +38,9 @@ func isDashboardStarredByUser(c *middleware.Context, dashId int64) (bool, error)
func
dashboardGuardianResponse
(
err
error
)
Response
{
if
err
!=
nil
{
return
ApiError
(
500
,
"Error while checking dashboard permissions"
,
err
)
}
else
{
return
ApiError
(
403
,
"Access denied to this dashboard"
,
nil
)
}
return
ApiError
(
403
,
"Access denied to this dashboard"
,
nil
)
}
func
GetDashboard
(
c
*
middleware
.
Context
)
Response
{
...
...
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