make projects list available to admins only, and update docs

This commit is contained in:
juhanikat
2026-09-28 13:49:17 +03:00
parent 5c065508b4
commit 5466c6ddf6
4 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import { writeProject } from '../services/write/project'
const router = Router()
router.get('/all', async (req, res) => {
router.get('/all', requireOneOf([Role.Admin]), async (req, res) => {
const projects = await getAllProjects(req.user)
return res.status(200).send(projects)
})
+1 -1
View File
@@ -91,7 +91,7 @@ NOTE: Users with the **EditRestricted** role can only update occurrences that re
## Project
- Any user can get a list of Projects.
- Viewing a list of projects requires the **Admin** role.
- Viewing project details requires the **Admin** role.
- Creating or updating a Project requires the **Admin** role.
- Deleting a Project requires the **Admin** role.
+1 -1
View File
@@ -26,7 +26,7 @@ export const NavBar = () => {
{ title: 'Time Units', url: '/time-unit' },
{ title: 'Time Bounds', url: '/time-bound', allowedRoles: [Role.Admin, Role.EditUnrestricted] },
{ title: 'Museums', url: '/museum' },
{ title: 'Projects', url: '/project' },
{ title: 'Projects', url: '/project', allowedRoles: [Role.Admin] },
{
title: 'Admin',
url: '/admin',
+1
View File
@@ -9,6 +9,7 @@ import { Page } from '../components/Page'
export const ProjectPage = () => {
return (
<Page
allowedRoles={[Role.Admin]}
tableView={<ProjectTable />}
detailView={<ProjectDetails />}
viewName="project"