Merge branch 'benjamin-perms' into 'main'

(admin) add community permission

See merge request PronounsPage/PronounsPage!468
This commit is contained in:
Andrea Vos 2024-06-03 15:37:36 +00:00
commit 1a73ddf760
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<template>
<Page>
<NotFound v-if="!$isGranted('users')" />
<NotFound v-if="!$isGranted('users') && !$isGranted('community')" />
<div v-else>
<p>
<nuxt-link to="/admin">

View File

@ -1,6 +1,6 @@
<template>
<Page>
<NotFound v-if="!$isGranted('users')" />
<NotFound v-if="!$isGranted('users') && !isGranted('community')" />
<div v-else>
<p>
<nuxt-link to="/admin">

View File

@ -78,7 +78,7 @@ router.get('/admin/list/footer', handleErrorAsync(async (req, res) => {
}));
router.get('/admin/users', handleErrorAsync(async (req, res) => {
if (!req.isGranted('users')) {
if (!req.isGranted('users') && !req.isGranted('community')) {
return res.status(401).json({ error: 'Unauthorised' });
}
@ -216,7 +216,7 @@ router.get('/admin/stats-public', handleErrorAsync(async (req, res) => {
}));
router.get('/admin/stats/users-chart/:locale', handleErrorAsync(async (req, res) => {
if (!req.isGranted('users')) {
if (!req.isGranted('users') && !req.isGranted('community')) {
return res.status(401).json({ error: 'Unauthorised' });
}