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:
parent
c0e1bd5045
commit
77ab56dbf8
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue