mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add CollaboratorsInviteController and routes
This commit is contained in:
parent
13d6448ab8
commit
e383e49161
3 changed files with 44 additions and 0 deletions
|
@ -0,0 +1,11 @@
|
||||||
|
CollaboratorsInviteHandler = require('./CollaboratorsInviteHandler')
|
||||||
|
|
||||||
|
module.exports = CollaboratorsInviteController =
|
||||||
|
|
||||||
|
inviteToProject: (req, res) ->
|
||||||
|
|
||||||
|
revokeInvite: (req, res) ->
|
||||||
|
|
||||||
|
viewInvite: (req, res) ->
|
||||||
|
|
||||||
|
acceptInvite: (req, res) ->
|
|
@ -0,0 +1,9 @@
|
||||||
|
module.experts = CollaboratorsInviteHandler =
|
||||||
|
|
||||||
|
inviteToProject: (callback) ->
|
||||||
|
|
||||||
|
revokeInvite: (callback) ->
|
||||||
|
|
||||||
|
viewInvite: (callback) ->
|
||||||
|
|
||||||
|
acceptInvite: (callback) ->
|
|
@ -1,6 +1,7 @@
|
||||||
CollaboratorsController = require('./CollaboratorsController')
|
CollaboratorsController = require('./CollaboratorsController')
|
||||||
AuthenticationController = require('../Authentication/AuthenticationController')
|
AuthenticationController = require('../Authentication/AuthenticationController')
|
||||||
AuthorizationMiddlewear = require('../Authorization/AuthorizationMiddlewear')
|
AuthorizationMiddlewear = require('../Authorization/AuthorizationMiddlewear')
|
||||||
|
CollaboratorsInviteController = require('./CollaboratorsInviteController')
|
||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
apply: (webRouter, apiRouter) ->
|
apply: (webRouter, apiRouter) ->
|
||||||
|
@ -8,3 +9,26 @@ module.exports =
|
||||||
|
|
||||||
webRouter.post '/project/:Project_id/users', AuthorizationMiddlewear.ensureUserCanAdminProject, CollaboratorsController.addUserToProject
|
webRouter.post '/project/:Project_id/users', AuthorizationMiddlewear.ensureUserCanAdminProject, CollaboratorsController.addUserToProject
|
||||||
webRouter.delete '/project/:Project_id/users/:user_id', AuthorizationMiddlewear.ensureUserCanAdminProject, CollaboratorsController.removeUserFromProject
|
webRouter.delete '/project/:Project_id/users/:user_id', AuthorizationMiddlewear.ensureUserCanAdminProject, CollaboratorsController.removeUserFromProject
|
||||||
|
|
||||||
|
# invites
|
||||||
|
webRouter.post(
|
||||||
|
'/project/:Project_id/invite',
|
||||||
|
AuthorizationMiddlewear.ensureUserCanAdminProject,
|
||||||
|
CollaboratorsInviteController.inviteToProject
|
||||||
|
)
|
||||||
|
|
||||||
|
webRouter.delete(
|
||||||
|
'/project/:Project_id/invite/:invite_id',
|
||||||
|
AuthorizationMiddlewear.ensureUserCanAdminProject,
|
||||||
|
CollaboratorsInviteController.revokeInvite
|
||||||
|
)
|
||||||
|
|
||||||
|
webRouter.get(
|
||||||
|
'/project/:Project_id/invite/token/:token_id',
|
||||||
|
CollaboratorsInviteController.viewInvite
|
||||||
|
)
|
||||||
|
|
||||||
|
webRouter.post(
|
||||||
|
'/project/:Project_id/invite/:invite_id/accept',
|
||||||
|
CollaboratorsInviteController.acceptInvite
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue