Add ability to list all local videos

Including private/unlisted for moderators/admins
This commit is contained in:
Chocobozzz 2018-10-10 11:46:50 +02:00
parent b014b6b9c7
commit 1cd3facc3d
No known key found for this signature in database
GPG key ID: 583A612D890159BE
17 changed files with 363 additions and 54 deletions

View file

@ -2,7 +2,6 @@ import * as express from 'express'
import * as multer from 'multer'
import { CONFIG, REMOTE_SCHEME } from '../initializers'
import { logger } from './logger'
import { User } from '../../shared/models/users'
import { deleteFileAsync, generateRandomString } from './utils'
import { extname } from 'path'
import { isArray } from './custom-validators/misc'
@ -101,7 +100,7 @@ function createReqFiles (
}
function isUserAbleToSearchRemoteURI (res: express.Response) {
const user: User = res.locals.oauth ? res.locals.oauth.token.User : undefined
const user: UserModel = res.locals.oauth ? res.locals.oauth.token.User : undefined
return CONFIG.SEARCH.REMOTE_URI.ANONYMOUS === true ||
(CONFIG.SEARCH.REMOTE_URI.USERS === true && user !== undefined)