mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Type functions
This commit is contained in:
parent
4d4e5cd4dc
commit
69818c9394
96 changed files with 990 additions and 544 deletions
|
@ -1,6 +1,9 @@
|
|||
import 'express-validator'
|
||||
import * as express from 'express'
|
||||
|
||||
import { logger } from '../helpers'
|
||||
|
||||
function ensureIsAdmin (req, res, next) {
|
||||
function ensureIsAdmin (req: express.Request, res: express.Response, next: express.NextFunction) {
|
||||
const user = res.locals.oauth.token.user
|
||||
if (user.isAdmin() === false) {
|
||||
logger.info('A non admin user is trying to access to an admin content.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue