mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Allow AI feature use for reviewers (#23843)
GitOrigin-RevId: 190c0ee4174d69d4429dba6c0c58d785b4afab7d
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user