Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

470 B
Raw Blame
"use client";

import { isOrgAdminForAnyOrg, isOrgAdminSessionRole } from "@/utils/roles";

import { useOrganizations } from "./organizations/useOrganizations";
import useAuthorized from "./useAuthorized";

const useIsOrgAdmin = (): boolean => {
  const { userId, userRole } = useAuthorized();
  const { data: organizations } = useOrganizations();
  return isOrgAdminSessionRole(userRole) || isOrgAdminForAnyOrg(organizations, userId);
};

export default useIsOrgAdmin;