fix(fleet-sync): open status and reset-anchor to Community admins (#1792)

Baseline Fleet Sync already replicates security policy on Community
code paths, but status and anchor recovery still required a paid
entitlement. Drop the residual paid gates while keeping admin and
node:manage authorization boundaries.
This commit is contained in:
Anso
2026-08-07 19:52:12 -04:00
committed by GitHub
parent 10b3cb6746
commit b9e73f7bd8
8 changed files with 100 additions and 99 deletions
@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import { describe, it, expect, afterEach, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import type { Node } from '@/context/NodeContext';
@@ -6,7 +6,6 @@ import type { Node } from '@/context/NodeContext';
// the test renders the panel in isolation and can drive the role/permission
// inputs that gate the write affordances.
const useAuthMock = vi.fn();
const useLicenseMock = vi.fn();
const testNode: Node = {
id: 2,
@@ -25,7 +24,6 @@ vi.mock('@/context/NodeContext', () => ({
useNodes: () => ({ nodes: [testNode], refreshNodeMeta: vi.fn() }),
}));
vi.mock('@/context/AuthContext', () => ({ useAuth: () => useAuthMock() }));
vi.mock('@/context/LicenseContext', () => ({ useLicense: () => useLicenseMock() }));
vi.mock('@/lib/api', () => ({
apiFetch: vi.fn(() => Promise.resolve({ ok: false, json: () => Promise.resolve({}) })),
}));
@@ -53,9 +51,6 @@ function canFor(...granted: string[]) {
return (action: string) => granted.includes(action);
}
beforeEach(() => {
useLicenseMock.mockReturnValue({ isPaid: false });
});
afterEach(() => vi.clearAllMocks());
describe('NodeManager write-affordance gating', () => {