AC: Remove legacy AC from dashboard permissions API (#71524)

* remove IsDisabled from org API

* remove IsDisabled from dashboard_permissions API
This commit is contained in:
Jo
2023-07-17 17:54:39 +02:00
committed by GitHub
parent 43f4e55a76
commit a7d905c03b
3 changed files with 18 additions and 38 deletions
-5
View File
@@ -11,7 +11,6 @@ import (
"github.com/grafana/grafana/pkg/infra/metrics"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
"github.com/grafana/grafana/pkg/web"
)
@@ -131,10 +130,6 @@ func (hs *HTTPServer) CreateOrg(c *contextmodel.ReqContext) response.Response {
if err := web.Bind(c.Req, &cmd); err != nil {
return response.Error(http.StatusBadRequest, "bad request data", err)
}
acEnabled := !hs.AccessControl.IsDisabled()
if !acEnabled && !(setting.AllowUserOrgCreate || c.IsGrafanaAdmin) {
return response.Error(http.StatusForbidden, "Access denied", nil)
}
cmd.UserID = c.UserID
result, err := hs.orgService.CreateWithMember(c.Req.Context(), &cmd)