From e383e491619b3478423776520b23fd4d14105d19 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Wed, 20 Jul 2016 14:04:14 +0100 Subject: [PATCH] Add CollaboratorsInviteController and routes --- .../CollaboratorsInviteController.coffee | 11 +++++++++ .../CollaboratorsInviteHandler.coffee | 9 +++++++ .../Collaborators/CollaboratorsRouter.coffee | 24 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee create mode 100644 services/web/app/coffee/Features/Collaborators/CollaboratorsInviteHandler.coffee diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee new file mode 100644 index 0000000000..e33b73ff90 --- /dev/null +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee @@ -0,0 +1,11 @@ +CollaboratorsInviteHandler = require('./CollaboratorsInviteHandler') + +module.exports = CollaboratorsInviteController = + + inviteToProject: (req, res) -> + + revokeInvite: (req, res) -> + + viewInvite: (req, res) -> + + acceptInvite: (req, res) -> diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteHandler.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteHandler.coffee new file mode 100644 index 0000000000..3b4c9617c6 --- /dev/null +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteHandler.coffee @@ -0,0 +1,9 @@ +module.experts = CollaboratorsInviteHandler = + + inviteToProject: (callback) -> + + revokeInvite: (callback) -> + + viewInvite: (callback) -> + + acceptInvite: (callback) -> diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee index 34a6da9a02..c2357994a3 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee @@ -1,6 +1,7 @@ CollaboratorsController = require('./CollaboratorsController') AuthenticationController = require('../Authentication/AuthenticationController') AuthorizationMiddlewear = require('../Authorization/AuthorizationMiddlewear') +CollaboratorsInviteController = require('./CollaboratorsInviteController') module.exports = apply: (webRouter, apiRouter) -> @@ -8,3 +9,26 @@ module.exports = webRouter.post '/project/:Project_id/users', AuthorizationMiddlewear.ensureUserCanAdminProject, CollaboratorsController.addUserToProject 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 + )