Alerting: Fix fine-grained rule access control to use 403 for authorization error (#79239)
* use 403 for authorization error * update silences API * add ForbiddenError to rule API responses
This commit is contained in:
@@ -1049,7 +1049,7 @@ func TestIntegrationAlertRuleCRUD(t *testing.T) {
|
||||
},
|
||||
expectedCode: func() int {
|
||||
if setting.IsEnterprise {
|
||||
return http.StatusUnauthorized
|
||||
return http.StatusForbidden
|
||||
}
|
||||
return http.StatusBadRequest
|
||||
}(),
|
||||
@@ -2285,7 +2285,7 @@ func TestIntegrationEval(t *testing.T) {
|
||||
expectedResponse: func() string { return "" },
|
||||
expectedStatusCode: func() int {
|
||||
if setting.IsEnterprise {
|
||||
return http.StatusUnauthorized
|
||||
return http.StatusForbidden
|
||||
}
|
||||
return http.StatusBadRequest
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user