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