fix(editor): Replace isInstanceOwner checks with scopes where applicable (#7858)
Co-authored-by: Alex Grozav <alex@grozav.com>
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user