RBAC: remove rbac disabled from preferences tests (#67712)

remove rbac disabled from preferences tests
This commit is contained in:
Eric Leijonmarck 2023-05-03 12:02:48 +01:00 committed by GitHub
parent 69402f859b
commit a3b10b2c8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,7 +189,6 @@ func TestAPIEndpoint_PutCurrentOrgPreferences_AccessControl(t *testing.T) {
func TestAPIEndpoint_PatchUserPreferences(t *testing.T) {
cfg := setting.NewCfg()
cfg.RBACEnabled = false
dashSvc := dashboards.NewFakeDashboardService(t)
qResult := &dashboards.Dashboard{UID: "home", ID: 1}
@ -240,7 +239,6 @@ func TestAPIEndpoint_PatchUserPreferences(t *testing.T) {
func TestAPIEndpoint_PatchOrgPreferences(t *testing.T) {
cfg := setting.NewCfg()
cfg.RBACEnabled = false
server := SetupAPITestServer(t, func(hs *HTTPServer) {
hs.Cfg = cfg
@ -250,8 +248,9 @@ func TestAPIEndpoint_PatchOrgPreferences(t *testing.T) {
input := strings.NewReader(testPatchOrgPreferencesCmd)
t.Run("Returns 200 on success", func(t *testing.T) {
req := webtest.RequestWithSignedInUser(server.NewRequest(http.MethodPatch, patchOrgPreferencesUrl, input), &user.SignedInUser{
OrgID: 1,
OrgRole: org.RoleAdmin,
OrgID: 1,
OrgRole: org.RoleAdmin,
Permissions: map[int64]map[string][]string{1: {accesscontrol.ActionOrgsPreferencesWrite: {}}},
})
response, err := server.SendJSON(req)
require.NoError(t, err)
@ -262,8 +261,9 @@ func TestAPIEndpoint_PatchOrgPreferences(t *testing.T) {
input = strings.NewReader(testPatchOrgPreferencesCmdBad)
t.Run("Returns 400 with bad data", func(t *testing.T) {
req := webtest.RequestWithSignedInUser(server.NewRequest(http.MethodPatch, patchOrgPreferencesUrl, input), &user.SignedInUser{
OrgID: 1,
OrgRole: org.RoleAdmin,
OrgID: 1,
OrgRole: org.RoleAdmin,
Permissions: map[int64]map[string][]string{1: {accesscontrol.ActionOrgsPreferencesWrite: {}}},
})
response, err := server.SendJSON(req)
require.NoError(t, err)