Remove permissions call which would get folders again (#98729)
* Remove permissions call which would get folders again * Remove comment
This commit is contained in:
@@ -22,7 +22,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
"github.com/grafana/grafana/pkg/services/search"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/searchstore"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
)
|
||||
@@ -299,12 +298,6 @@ func (l *LibraryElementService) getLibraryElements(c context.Context, store db.D
|
||||
builder.Write(getFromLibraryElementDTOWithMeta(store.GetDialect()))
|
||||
builder.Write(" INNER JOIN dashboard AS dashboard on le.folder_id = dashboard.id AND le.folder_id <> 0")
|
||||
writeParamSelectorSQL(&builder, params...)
|
||||
|
||||
// use permission filter if lib panel RBAC isn't enabled
|
||||
if !l.features.IsEnabled(c, featuremgmt.FlagLibraryPanelRBAC) {
|
||||
builder.WriteDashboardPermissionFilter(signedInUser, dashboardaccess.PERMISSION_VIEW, searchstore.TypeFolder)
|
||||
}
|
||||
|
||||
builder.Write(` OR dashboard.id=0`)
|
||||
if err := session.SQL(builder.GetSQLString(), builder.GetParams()...).Find(&libraryElements); err != nil {
|
||||
return err
|
||||
|
||||
@@ -362,7 +362,7 @@ func TestLibraryElementsGetPermissions(t *testing.T) {
|
||||
permissions: map[string][]string{
|
||||
dashboards.ActionFoldersRead: {dashboards.ScopeFoldersProvider.GetResourceScopeUID("Other_folder")},
|
||||
},
|
||||
status: http.StatusNotFound,
|
||||
status: http.StatusForbidden,
|
||||
},
|
||||
}
|
||||
for _, testCase := range getCases {
|
||||
|
||||
Reference in New Issue
Block a user