mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
26 lines
1 KiB
CoffeeScript
26 lines
1 KiB
CoffeeScript
AuthenticationController = require('../Authentication/AuthenticationController')
|
|
UserMembershipController = require './UserMembershipController'
|
|
|
|
module.exports =
|
|
apply: (webRouter) ->
|
|
webRouter.get '/manage/group/members',
|
|
AuthenticationController.requireLogin(),
|
|
(req, res, next) -> UserMembershipController.index('group', req, res, next)
|
|
|
|
|
|
regularEntitites =
|
|
group: 'groupManagers'
|
|
institution: 'institution'
|
|
for pathName, entityName of regularEntitites
|
|
do (pathName, entityName) ->
|
|
webRouter.get "/manage/#{pathName}/managers",
|
|
AuthenticationController.requireLogin(),
|
|
(req, res, next) -> UserMembershipController.index(entityName, req, res, next)
|
|
|
|
webRouter.post "/manage/#{pathName}/managers",
|
|
AuthenticationController.requireLogin(),
|
|
(req, res, next) -> UserMembershipController.add(entityName, req, res, next)
|
|
|
|
webRouter.delete "/manage/#{pathName}/managers/:userId",
|
|
AuthenticationController.requireLogin(),
|
|
(req, res, next) -> UserMembershipController.remove(entityName, req, res, next)
|