mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
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:
parent
8abda70bfd
commit
f77894c427
2 changed files with 4 additions and 2 deletions
|
@ -450,9 +450,11 @@ module.exports = {
|
|||
getUserRestrictions,
|
||||
getUserValidationStatus: callbackify(getUserValidationStatus),
|
||||
checkCollaboratorsPermission: callbackify(checkUserListPermissions),
|
||||
checkUserPermissions: callbackify(checkUserPermissions),
|
||||
promises: {
|
||||
assertUserPermissions,
|
||||
getUserValidationStatus,
|
||||
checkUserListPermissions,
|
||||
checkUserPermissions,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -613,10 +613,10 @@ const _ProjectController = {
|
|||
!showPersonalAccessToken &&
|
||||
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
|
||||
try {
|
||||
await checkUserPermissions(user, ['use-ai'])
|
||||
canUseAi = true
|
||||
canUseAi = await checkUserPermissions(user, ['use-ai'])
|
||||
} catch (err) {
|
||||
canUseAi = false
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue