mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 09:45:37 -04:00
Cleanups lib/web/note
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
280fda1d6c
commit
5a6ec56a7e
3 changed files with 6 additions and 21 deletions
|
@ -2,7 +2,6 @@ import { Request, Response } from 'express'
|
|||
import fs from 'fs'
|
||||
|
||||
import path from 'path'
|
||||
import { Includeable } from 'sequelize'
|
||||
import { config } from '../../config'
|
||||
import { errors } from '../../errors'
|
||||
import { logger } from '../../logger'
|
||||
|
@ -33,7 +32,7 @@ export function newNote (req, res: Response, body: string | null): void {
|
|||
})
|
||||
}
|
||||
|
||||
export function checkViewPermission (req, note: any): boolean {
|
||||
export function checkViewPermission (req, note: Note): boolean {
|
||||
if (note.permission === 'private') {
|
||||
return req.isAuthenticated() && note.ownerId === req.user.id
|
||||
} else if (note.permission === 'limited' || note.permission === 'protected') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue