1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

Tweaked app subscription logic

This commit is contained in:
Harvey Kandola 2018-11-11 16:54:36 +00:00
parent c0e1bd5045
commit 77ab56dbf8
2 changed files with 6 additions and 1 deletions

View file

@ -119,6 +119,11 @@ func (p *Product) IsValid(ctx RequestContext) bool {
if time.Now().UTC().Before(ctx.Subscription.End) && uc <= int(ctx.Subscription.Seats) { if time.Now().UTC().Before(ctx.Subscription.End) && uc <= int(ctx.Subscription.Seats) {
return true return true
} }
} else {
// First 10 is free for Enterprise edition.
if Seats1 == ctx.Subscription.Seats && time.Now().UTC().Before(ctx.Subscription.End) {
return true
}
} }
return false return false

View file

@ -169,7 +169,7 @@ func (m *middleware) Authorize(w http.ResponseWriter, r *http.Request, next http
} }
} }
// Tag all HTTP calls with subscription statu // Tag all HTTP calls with subscription status
subs := "false" subs := "false"
if m.Runtime.Product.IsValid(rc) { if m.Runtime.Product.IsValid(rc) {
subs = "true" subs = "true"