Commit 32452270 by Leonard Gram

permissions: cleanup.

parent b7b0ce01
......@@ -17,24 +17,8 @@ func GetDataSources(c *m.ReqContext) Response {
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)
for _, ds := range datasources {
for _, ds := range query.Result {
dsItem := dtos.DataSourceListItemDTO{
OrgId: ds.OrgId,
Id: ds.Id,
......
......@@ -195,8 +195,8 @@ type GetDataSourceByNameQuery struct {
type DsPermissionType int
const (
DsPermissionQuery DsPermissionType = 1 << iota
DsPermissionNoAccess
DsPermissionNoAccess DsPermissionType = iota
DsPermissionQuery
)
func (p DsPermissionType) String() string {
......@@ -207,12 +207,6 @@ func (p DsPermissionType) String() string {
return names[int(p)]
}
type HasRequiredDataSourcePermissionQuery struct {
Id int64
User *SignedInUser
RequiredPermission DsPermissionType
}
type GetDataSourcePermissionsForUserQuery struct {
User *SignedInUser
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