mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
20 lines
745 B
CoffeeScript
20 lines
745 B
CoffeeScript
SubscriptionDomainHandler = require("../Subscription/SubscriptionDomainHandler")
|
|
NotificationsBuilder = require("../Notifications/NotificationsBuilder")
|
|
SubscriptionGroupHandler = require("../Subscription/SubscriptionGroupHandler")
|
|
|
|
module.exports = UserHandler =
|
|
|
|
_populateGroupLicenceInvite: (user, callback)->
|
|
licence = SubscriptionDomainHandler.getLicenceUserCanJoin user
|
|
if !licence?
|
|
return callback()
|
|
|
|
SubscriptionGroupHandler.isUserPartOfGroup user._id, licence.subscription_id, (err, alreadyPartOfGroup)->
|
|
if err? or alreadyPartOfGroup
|
|
return callback(err)
|
|
else
|
|
NotificationsBuilder.groupPlan(user, licence).create(callback)
|
|
|
|
setupLoginData: (user, callback = ->)->
|
|
_populateGroupLicenceInvite user, callback
|
|
|