Commit 32452270 by Leonard Gram

permissions: cleanup.

parent b7b0ce01
...@@ -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,
......
...@@ -195,8 +195,8 @@ type GetDataSourceByNameQuery struct { ...@@ -195,8 +195,8 @@ type GetDataSourceByNameQuery struct {
type DsPermissionType int type DsPermissionType int
const ( const (
DsPermissionQuery DsPermissionType = 1 << iota DsPermissionNoAccess DsPermissionType = iota
DsPermissionNoAccess DsPermissionQuery
) )
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment