mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
make projects list available to admins only, and update docs
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -9,6 +9,7 @@ import { Page } from '../components/Page'
|
||||
export const ProjectPage = () => {
|
||||
return (
|
||||
<Page
|
||||
allowedRoles={[Role.Admin]}
|
||||
tableView={<ProjectTable />}
|
||||
detailView={<ProjectDetails />}
|
||||
viewName="project"
|
||||
|
||||
Reference in New Issue
Block a user