Phase 14, parts 5 and 6: seats, and moving down to Free

Seats: inviting past the seats paid for offers the owner to add one
(Stripe prorates it); admins are told to ask the owner; Free has two.
Moving down: past the plan's seats, the owner and one other (the owner's
pick, or the first to join) edit and the rest read; storage is measured
hourly, and past the plan's, photo uploads and the SEO crawl stop.
Nothing is deleted. TEST.md section 18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 13:34:22 -07:00
co-authored by Claude Opus 5.5
parent aa0408fb14
commit 6d3eb18b5e
16 changed files with 573 additions and 6 deletions
+10
View File
@@ -183,6 +183,16 @@ func (s *Server) allow(area string, next http.Handler) http.Handler {
return
}
if !v.can(area, write) {
if write && v.OverSeats {
msg := "The team has more people than its plan has seats, so you can read, not change. The team's owner chooses who keeps editing, under Settings → Billing."
if ts, err := s.teamServer(r); err == nil {
if _, plan := ts.kept(); plan != nil {
msg = fmt.Sprintf("The %s plan has %d people, and the team has more, so you can read, not change. The team's owner chooses who keeps editing, under Settings → Billing, or moves up a plan.", plan.Name, plan.Seats)
}
}
http.Error(w, msg, http.StatusForbidden)
return
}
// A module the team's plan has only to read: say so.
if write && v.Member.Cap != nil && v.Member.Cap[area] == users.View && v.Member.Can(area, false) {
if ts, err := s.teamServer(r); err == nil {