mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
dffb6bc7a2
Add Publisher Entity for UserMemberships GitOrigin-RevId: 862b1e4fe6d33b63ddfdaef47c02809c4558f9cc
56 lines
2.4 KiB
CoffeeScript
56 lines
2.4 KiB
CoffeeScript
UserMembershipAuthorization = require './UserMembershipAuthorization'
|
|
UserMembershipController = require './UserMembershipController'
|
|
SubscriptionGroupController = require '../Subscription/SubscriptionGroupController'
|
|
TeamInvitesController = require '../Subscription/TeamInvitesController'
|
|
|
|
module.exports =
|
|
apply: (webRouter) ->
|
|
# group members routes
|
|
webRouter.get '/manage/groups/:id/members',
|
|
UserMembershipAuthorization.requireGroupAccess,
|
|
UserMembershipController.index
|
|
webRouter.post '/manage/groups/:id/invites',
|
|
UserMembershipAuthorization.requireGroupAccess,
|
|
TeamInvitesController.createInvite
|
|
webRouter.delete '/manage/groups/:id/user/:user_id',
|
|
UserMembershipAuthorization.requireGroupAccess,
|
|
SubscriptionGroupController.removeUserFromGroup
|
|
webRouter.delete '/manage/groups/:id/invites/:email',
|
|
UserMembershipAuthorization.requireGroupAccess,
|
|
TeamInvitesController.revokeInvite
|
|
webRouter.get '/manage/groups/:id/members/export',
|
|
UserMembershipAuthorization.requireGroupAccess,
|
|
UserMembershipController.exportCsv
|
|
|
|
# group managers routes
|
|
webRouter.get "/manage/groups/:id/managers",
|
|
UserMembershipAuthorization.requireGroupManagersAccess,
|
|
UserMembershipController.index
|
|
webRouter.post "/manage/groups/:id/managers",
|
|
UserMembershipAuthorization.requireGroupManagersAccess,
|
|
UserMembershipController.add
|
|
webRouter.delete "/manage/groups/:id/managers/:userId",
|
|
UserMembershipAuthorization.requireGroupManagersAccess,
|
|
UserMembershipController.remove
|
|
|
|
# institution members routes
|
|
webRouter.get "/manage/institutions/:id/managers",
|
|
UserMembershipAuthorization.requireInstitutionAccess,
|
|
UserMembershipController.index
|
|
webRouter.post "/manage/institutions/:id/managers",
|
|
UserMembershipAuthorization.requireInstitutionAccess,
|
|
UserMembershipController.add
|
|
webRouter.delete "/manage/institutions/:id/managers/:userId",
|
|
UserMembershipAuthorization.requireInstitutionAccess,
|
|
UserMembershipController.remove
|
|
|
|
# publisher members routes
|
|
webRouter.get "/manage/publishers/:id/managers",
|
|
UserMembershipAuthorization.requirePublisherAccess,
|
|
UserMembershipController.index
|
|
webRouter.post "/manage/publishers/:id/managers",
|
|
UserMembershipAuthorization.requirePublisherAccess,
|
|
UserMembershipController.add
|
|
webRouter.delete "/manage/publishers/:id/managers/:userId",
|
|
UserMembershipAuthorization.requirePublisherAccess,
|
|
UserMembershipController.remove
|