mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #28089 from overleaf/dk-dsmp-post-chat-message
Add support for posting chat messages GitOrigin-RevId: 817d723abf6309716c4cfa61e2c260cb7ace0bda
This commit is contained in:
@@ -99,11 +99,14 @@ function requirePermission(...requiredCapabilities) {
|
||||
if (!Features.hasFeature('saas')) {
|
||||
return next()
|
||||
}
|
||||
if (!req.user) {
|
||||
if (!req.user && !req.oauth_user) {
|
||||
return next(new Error('no user'))
|
||||
}
|
||||
try {
|
||||
await assertUserPermissions(req.user, requiredCapabilities)
|
||||
await assertUserPermissions(
|
||||
req.user || req.oauth_user,
|
||||
requiredCapabilities
|
||||
)
|
||||
next()
|
||||
} catch (error) {
|
||||
next(error)
|
||||
|
||||
Reference in New Issue
Block a user