diff --git a/common/envs/constants.ts b/common/envs/constants.ts index 7092d711..48f9bf63 100644 --- a/common/envs/constants.ts +++ b/common/envs/constants.ts @@ -25,6 +25,10 @@ export function isAdmin(email: string) { return ENV_CONFIG.adminEmails.includes(email) } +export function isManifoldId(userId: string) { + return userId === 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2' +} + export const DOMAIN = ENV_CONFIG.domain export const FIREBASE_CONFIG = ENV_CONFIG.firebaseConfig export const PROJECT_ID = ENV_CONFIG.firebaseConfig.projectId diff --git a/functions/src/resolve-market.ts b/functions/src/resolve-market.ts index cc07d4be..7277f40b 100644 --- a/functions/src/resolve-market.ts +++ b/functions/src/resolve-market.ts @@ -18,7 +18,7 @@ import { groupPayoutsByUser, Payout, } from '../../common/payouts' -import { isAdmin } from '../../common/envs/constants' +import { isManifoldId } from '../../common/envs/constants' import { removeUndefinedProps } from '../../common/util/object' import { LiquidityProvision } from '../../common/liquidity-provision' import { APIError, newEndpoint, validate } from './api' @@ -82,7 +82,7 @@ export const resolvemarket = newEndpoint(opts, async (req, auth) => { req.body ) - if (creatorId !== auth.uid && !isAdmin(auth.uid)) + if (creatorId !== auth.uid && !isManifoldId(auth.uid)) throw new APIError(403, 'User is not creator of contract') if (contract.resolution) throw new APIError(400, 'Contract already resolved')