don't regard v1 teams as paid subscriptions

- use `userHasV1Subscription` instead of `userHasV1SubscriptionOrTeam` in `LimitationsManager.userHasSubscriptionOrIsGroupMember `
- remove `userHasV1SubscriptionOrTeam`
- rename `LimitationsManager.userHasSubscriptionOrIsGroupMember` to `LimitationsManager.hasPaidSubscription`
- rename some variables for clarity
This commit is contained in:
Tim Alby
2018-09-03 15:09:57 +01:00
parent 5025b54c9c
commit 3324796086
6 changed files with 29 additions and 68 deletions
@@ -189,10 +189,10 @@ module.exports = ProjectController =
return cb(null, projects: [], tags: [], noConnection: true)
return cb(error, projects[0]) # hooks.fire returns an array of results, only need first
hasSubscription: (cb)->
LimitationsManager.userHasSubscriptionOrIsGroupMember currentUser, (error, hasSub) ->
LimitationsManager.hasPaidSubscription currentUser, (error, hasPaidSubscription) ->
if error? and error instanceof V1ConnectionError
return cb(null, true)
return cb(error, hasSub)
return cb(error, hasPaidSubscription)
user: (cb) ->
User.findById user_id, "featureSwitches overleaf awareOfV2 features", cb
}, (err, results)->