import { hasRequiredScope } from "./dual-auth";
function isSuperAdmin(authResult) {
  if (!authResult.success || !authResult.user) {
    return false;
  }
  return authResult.user.role === "superadmin";
}
function hasAdminPermission(authResult, requiredScope) {
  if (!isSuperAdmin(authResult)) {
    return false;
  }
  if (authResult.type === "api-key" && requiredScope) {
    return hasRequiredScope(authResult, requiredScope);
  }
  return true;
}
export {
  hasAdminPermission,
  isSuperAdmin
};
