fix(web): gate staff-only Convex queries to avoid RBAC errors on dashboard and tickets; docs: add desktop agent history and troubleshooting
This commit is contained in:
parent
7685370c05
commit
ab820ddeca
11 changed files with 144 additions and 33 deletions
|
|
@ -33,12 +33,13 @@ function formatScore(value: number | null) {
|
|||
}
|
||||
|
||||
export function SectionCards() {
|
||||
const { session, convexUserId } = useAuth()
|
||||
const { session, convexUserId, isStaff } = useAuth()
|
||||
const tenantId = session?.user.tenantId ?? DEFAULT_TENANT_ID
|
||||
|
||||
const dashboardEnabled = Boolean(isStaff && convexUserId)
|
||||
const dashboard = useQuery(
|
||||
api.reports.dashboardOverview,
|
||||
convexUserId ? { tenantId, viewerId: convexUserId as Id<"users"> } : "skip"
|
||||
dashboardEnabled ? { tenantId, viewerId: convexUserId as Id<"users"> } : "skip"
|
||||
)
|
||||
|
||||
const trendInfo = useMemo(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue