mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
27 lines
637 B
CoffeeScript
27 lines
637 B
CoffeeScript
|
module.exports =
|
||
|
ensureUserCanReadMultipleProjects: (req, res, next) ->
|
||
|
next()
|
||
|
|
||
|
ensureUserCanReadProject: (req, res, next) ->
|
||
|
next()
|
||
|
|
||
|
ensureUserCanWriteProjectSettings: (req, res, next) ->
|
||
|
next()
|
||
|
|
||
|
ensureUserCanWriteProjectContent: (req, res, next) ->
|
||
|
next()
|
||
|
|
||
|
ensureUserCanAdminProject: (req, res, next) ->
|
||
|
next()
|
||
|
|
||
|
ensureUserIsSiteAdmin: (req, res, next) ->
|
||
|
next()
|
||
|
|
||
|
restricted : (req, res, next)->
|
||
|
if req.session.user?
|
||
|
res.render 'user/restricted',
|
||
|
title:'restricted'
|
||
|
else
|
||
|
logger.log "user not logged in and trying to access #{req.url}, being redirected to login"
|
||
|
res.redirect '/register'
|
||
|
|