@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user