AccessControl: Remove legacy frontend AC checks (#76187)

* remove legacy ac checks

* fix RBAC disabled tests

* add permissions for tests to work

* fix unifiedalertstatesworker test
This commit is contained in:
Jo
2023-10-09 18:10:06 +02:00
committed by GitHub
parent 165b4c3f66
commit 28c0fb1cfd
26 changed files with 123 additions and 201 deletions

View File

@@ -3,7 +3,7 @@ import { lastValueFrom } from 'rxjs';
import { AlertState, getDefaultTimeRange, TimeRange } from '@grafana/data';
import { config } from '@grafana/runtime';
import { backendSrv } from 'app/core/services/backend_srv';
import { disableRBAC, enableRBAC, grantUserPermissions } from 'app/features/alerting/unified/mocks';
import { grantUserPermissions } from 'app/features/alerting/unified/mocks';
import { Annotation } from 'app/features/alerting/unified/utils/constants';
import { createDashboardModelFixture } from 'app/features/dashboard/state/__fixtures__/dashboardFixtures';
import { AccessControlAction } from 'app/types/accessControl';
@@ -47,10 +47,7 @@ describe('UnifiedAlertStatesWorker', () => {
beforeEach(() => {
config.publicDashboardAccessToken = '';
});
beforeAll(() => {
disableRBAC();
grantUserPermissions(Object.values(AccessControlAction));
});
describe('when canWork is called with correct props', () => {
@@ -231,7 +228,6 @@ describe('UnifiedAlertStatesWorker', () => {
describe('UnifiedAlertStateWorker with RBAC', () => {
beforeAll(() => {
enableRBAC();
grantUserPermissions([]);
});