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
32452270
Commit
32452270
authored
Oct 17, 2018
by
Leonard Gram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
permissions: cleanup.
parent
b7b0ce01
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
25 deletions
+3
-25
pkg/api/datasources.go
+1
-17
pkg/models/datasource.go
+2
-8
No files found.
pkg/api/datasources.go
View file @
32452270
...
@@ -17,24 +17,8 @@ func GetDataSources(c *m.ReqContext) Response {
...
@@ -17,24 +17,8 @@ func GetDataSources(c *m.ReqContext) Response {
return
Error
(
500
,
"Failed to query datasources"
,
err
)
return
Error
(
500
,
"Failed to query datasources"
,
err
)
}
}
dsFilterQuery
:=
m
.
DatasourcesPermissionFilterQuery
{
User
:
c
.
SignedInUser
,
Datasources
:
query
.
Result
,
}
var
datasources
[]
*
m
.
DataSource
if
err
:=
bus
.
Dispatch
(
&
dsFilterQuery
);
err
!=
nil
{
if
err
!=
bus
.
ErrHandlerNotFound
{
return
Error
(
500
,
"Could not get datasources"
,
err
)
}
datasources
=
query
.
Result
}
else
{
datasources
=
dsFilterQuery
.
Result
}
result
:=
make
(
dtos
.
DataSourceList
,
0
)
result
:=
make
(
dtos
.
DataSourceList
,
0
)
for
_
,
ds
:=
range
datasources
{
for
_
,
ds
:=
range
query
.
Result
{
dsItem
:=
dtos
.
DataSourceListItemDTO
{
dsItem
:=
dtos
.
DataSourceListItemDTO
{
OrgId
:
ds
.
OrgId
,
OrgId
:
ds
.
OrgId
,
Id
:
ds
.
Id
,
Id
:
ds
.
Id
,
...
...
pkg/models/datasource.go
View file @
32452270
...
@@ -195,8 +195,8 @@ type GetDataSourceByNameQuery struct {
...
@@ -195,8 +195,8 @@ type GetDataSourceByNameQuery struct {
type
DsPermissionType
int
type
DsPermissionType
int
const
(
const
(
DsPermission
Query
DsPermissionType
=
1
<<
iota
DsPermission
NoAccess
DsPermissionType
=
iota
DsPermission
NoAccess
DsPermission
Query
)
)
func
(
p
DsPermissionType
)
String
()
string
{
func
(
p
DsPermissionType
)
String
()
string
{
...
@@ -207,12 +207,6 @@ func (p DsPermissionType) String() string {
...
@@ -207,12 +207,6 @@ func (p DsPermissionType) String() string {
return
names
[
int
(
p
)]
return
names
[
int
(
p
)]
}
}
type
HasRequiredDataSourcePermissionQuery
struct
{
Id
int64
User
*
SignedInUser
RequiredPermission
DsPermissionType
}
type
GetDataSourcePermissionsForUserQuery
struct
{
type
GetDataSourcePermissionsForUserQuery
struct
{
User
*
SignedInUser
User
*
SignedInUser
Result
map
[
int64
]
DsPermissionType
Result
map
[
int64
]
DsPermissionType
...
...
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