Allow AI feature use for reviewers (#23843)

GitOrigin-RevId: 190c0ee4174d69d4429dba6c0c58d785b4afab7d
This commit is contained in:
Alf Eaton
2025-02-27 11:06:49 +00:00
committed by Copybot
parent 0abdbc0093
commit c9320eb7a1

View File

@@ -647,11 +647,12 @@ const _ProjectController = {
if (userId && Features.hasFeature('saas')) {
try {
// exit early if the user couldnt use ai anyways, since permissions checks are expensive
const canEditProject =
const canUserWriteOrReviewProjectContent =
privilegeLevel === PrivilegeLevels.READ_AND_WRITE ||
privilegeLevel === PrivilegeLevels.OWNER
privilegeLevel === PrivilegeLevels.OWNER ||
privilegeLevel === PrivilegeLevels.REVIEW
if (canEditProject) {
if (canUserWriteOrReviewProjectContent) {
// check permissions for user and project owner, to see if they allow AI on the project
const permissionsResults = await Modules.promises.hooks.fire(
'projectAllowsCapability',