Merge pull request #19238 from overleaf/jdt-use-ai-project-fix

feat: matching rename to checkPermissions within projectController
GitOrigin-RevId: ea05800c145858237fb0b236f9a19837c6c4a9a2
This commit is contained in:
Jimmy Domagala-Tang 2024-07-02 09:31:12 -04:00 committed by Copybot
parent 8abda70bfd
commit f77894c427
2 changed files with 4 additions and 2 deletions

View file

@ -450,9 +450,11 @@ module.exports = {
getUserRestrictions, getUserRestrictions,
getUserValidationStatus: callbackify(getUserValidationStatus), getUserValidationStatus: callbackify(getUserValidationStatus),
checkCollaboratorsPermission: callbackify(checkUserListPermissions), checkCollaboratorsPermission: callbackify(checkUserListPermissions),
checkUserPermissions: callbackify(checkUserPermissions),
promises: { promises: {
assertUserPermissions, assertUserPermissions,
getUserValidationStatus, getUserValidationStatus,
checkUserListPermissions, checkUserListPermissions,
checkUserPermissions,
}, },
} }

View file

@ -613,10 +613,10 @@ const _ProjectController = {
!showPersonalAccessToken && !showPersonalAccessToken &&
splitTestAssignments['personal-access-token'].variant === 'enabled' // `?personal-access-token=enabled` splitTestAssignments['personal-access-token'].variant === 'enabled' // `?personal-access-token=enabled`
// still allow users to access project if we cant get their permissions, but disable AI feature
let canUseAi let canUseAi
try { try {
await checkUserPermissions(user, ['use-ai']) canUseAi = await checkUserPermissions(user, ['use-ai'])
canUseAi = true
} catch (err) { } catch (err) {
canUseAi = false canUseAi = false
} }