Alerting: Optimize prometheus api permission checks (#106299)
* Alerting: Optimize prometheus api permission checks This improves the performance of the Prometheus API by performing the permission checks for rule read permission in a folder upfront, rather than checking permissions for each rule group individually. This reduces the number of permission checks and should speed up the API response time. * refactor vars --------- Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
This commit is contained in:
co-authored by
Konrad Lalik
parent
6fd66dd690
commit
941162ca79
@@ -129,6 +129,10 @@ var _ ac.AccessControl = &recordingAccessControlFake{}
|
||||
type fakeRuleAccessControlService struct {
|
||||
}
|
||||
|
||||
func (f *fakeRuleAccessControlService) HasAccessInFolder(ctx context.Context, user identity.Requester, folder models.Namespaced) (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (f fakeRuleAccessControlService) HasAccessToRuleGroup(ctx context.Context, user identity.Requester, rules models.RulesGroup) (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user