We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bc1a5f commit 1b083faCopy full SHA for 1b083fa
api/src/events/router.ts
@@ -13,7 +13,8 @@ export default router
13
14
router.get('', async (req, res, next) => {
15
const sessionState = await session.reqAuthenticated(req)
16
- const { account, lang } = sessionState
+ const { account, lang, accountRole } = sessionState
17
+ if (accountRole !== 'admin') throw httpError(403, 'admin only')
18
19
const query: Filter<FullEvent> = { 'sender.type': account.type, 'sender.id': account.id }
20
if (req.query.q && typeof req.query.q === 'string') query.$text = { $search: req.query.q, $language: lang || config.i18n.defaultLocale }
0 commit comments