Skip to content

Conversation

@aldenhallak
Copy link
Collaborator

@aldenhallak aldenhallak commented Dec 15, 2025

Description

If a user has isAdmin: true, they should be able to modify any experiment.

Modify.backed.webm

Related issues

This PR fixes: #916, #824


Copy link
Collaborator

@vivtsai vivtsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title of the PR is misleading—it says "updates to any experiment," but the changes here are only regarding cohort editing (not, for instance, experiment deletion). Could we either rename the PR or include the other update cases?

@aldenhallak aldenhallak requested a review from vivtsai December 15, 2025 22:30
const allowlistDoc = await app
.firestore()
.collection('allowlist')
.doc(email || '')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty string case will throw a Firebase error—maybe just check for whether email is valid before this line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Collaborator

@vivtsai vivtsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing! I'm thinking we want this check to be in the functions in functions/src/experiment.utils.ts so that the REST API calls also enable admins to edit. WDYT?

vivtsai

This comment was marked as duplicate.

aldenhallak and others added 2 commits December 15, 2025 18:01
…AdminEmail` checks into utility functions and removing `isCreatorOrAdmin` checks from endpoints.
@aldenhallak aldenhallak requested a review from vivtsai December 15, 2025 23:02
@vivtsai vivtsai merged commit 7d89fe9 into PAIR-code:main Dec 16, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow admins to update ANY experiment.

2 participants