Access Control: Remove unused option (#48317)

* Remove unused option
This commit is contained in:
Karl Persson
2022-04-29 11:05:51 +02:00
committed by GitHub
parent 412dbc21e3
commit c207ea30eb
4 changed files with 5 additions and 84 deletions
@@ -2,7 +2,6 @@ package resourcepermissions
import (
"net/http"
"strconv"
"github.com/grafana/grafana/pkg/models"
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
@@ -10,21 +9,6 @@ import (
"github.com/grafana/grafana/pkg/web"
)
func solveUID(solve UidSolver) web.Handler {
return func(c *models.ReqContext) {
if solve != nil && util.IsValidShortUID(web.Params(c.Req)[":resourceID"]) {
params := web.Params(c.Req)
id, err := solve(c.Req.Context(), c.OrgId, params[":resourceID"])
if err != nil {
c.JsonApiErr(http.StatusNotFound, "Resource not found", err)
return
}
params[":resourceID"] = strconv.FormatInt(id, 10)
web.SetURLParams(c.Req, params)
}
}
}
// solveInheritedScopes will add the inherited scopes to the context param by prefix
// Ex: params["folders:uid:"] = "folders:uid:BCeknZL7k"
func solveInheritedScopes(solve InheritedScopesSolver) web.Handler {