RBAC: Fix authorize in org (#81552)

* RBAC: Fix authorize in org

* Implement option 2

* Fix typo

* Fix alerting test

* Add test to cover the not member case
This commit is contained in:
Gabriel MABILLE
2024-02-01 12:37:01 +01:00
committed by GitHub
parent 0f1ba3a9fe
commit 3df0611f81
8 changed files with 80 additions and 11 deletions
@@ -11,6 +11,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/models/roletype"
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/accesscontrol/resourcepermissions"
"github.com/grafana/grafana/pkg/services/datasources"
@@ -92,9 +93,10 @@ func TestBacktesting(t *testing.T) {
t.Run("if user does not have permissions", func(t *testing.T) {
testUserId := createUser(t, env.SQLStore, user.CreateUserCommand{
DefaultOrgRole: "",
DefaultOrgRole: string(roletype.RoleNone),
Password: "test",
Login: "test",
OrgID: 1,
})
testUserApiCli := newAlertingApiClient(grafanaListedAddr, "test", "test")