fix: harden machine session fallback and clean lint

This commit is contained in:
Esdras Renan 2025-10-19 03:16:50 -03:00
parent 2607ca5ce3
commit 846e575637
6 changed files with 60 additions and 32 deletions

View file

@ -2,9 +2,6 @@ import { mutation, query } from "./_generated/server";
import { ConvexError, v } from "convex/values";
import { requireAdmin } from "./rbac";
// All roles that have staff-level access in some areas. Do NOT include COLLABORATOR here
// to avoid leaking collaborators into staff pickers such as "responsável".
const STAFF_ROLES = new Set(["ADMIN", "MANAGER", "AGENT"]);
const INTERNAL_STAFF_ROLES = new Set(["ADMIN", "AGENT"]);
export const ensureUser = mutation({