Cleanups lib/web/note

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-05-24 21:09:03 +02:00
parent 280fda1d6c
commit 5a6ec56a7e
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
3 changed files with 6 additions and 21 deletions

View file

@ -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') {