fix(editor): Replace isInstanceOwner checks with scopes where applicable (#7858)

Co-authored-by: Alex Grozav <alex@grozav.com>
This commit is contained in:
Csaba Tuncsik
2023-12-04 10:02:54 +01:00
committed by GitHub
parent 39fa8d21bb
commit 132d691cbf
21 changed files with 111 additions and 67 deletions

View File

@@ -6,6 +6,7 @@ vi.mock('@/rbac/checks', () => ({
hasScope: vi.fn(),
isGuest: vi.fn(),
isDefaultUser: vi.fn(),
isInstanceOwner: vi.fn(),
isAuthenticated: vi.fn(),
isEnterpriseFeatureEnabled: vi.fn(),
isValid: vi.fn(),
@@ -17,6 +18,7 @@ describe('hasPermission()', () => {
vi.mocked(checks.hasScope).mockReturnValue(true);
vi.mocked(checks.isGuest).mockReturnValue(true);
vi.mocked(checks.isDefaultUser).mockReturnValue(true);
vi.mocked(checks.isInstanceOwner).mockReturnValue(true);
vi.mocked(checks.isAuthenticated).mockReturnValue(true);
vi.mocked(checks.isEnterpriseFeatureEnabled).mockReturnValue(true);
vi.mocked(checks.isValid).mockReturnValue(true);
@@ -30,6 +32,7 @@ describe('hasPermission()', () => {
'rbac',
'role',
'defaultUser',
'instanceOwner',
]),
).toBe(true);
});