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,
|
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,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue