import { opaAllow } from "./opaClient";

export async function checkAccess(params: {
  userId: string;
  resourceName: string;
  action: string;
}): Promise<boolean> {
  return opaAllow({
    input: {
      user: { id: params.userId },
      resource: { name: params.resourceName },
      action: params.action,
    },
  });
}
