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:
@@ -166,6 +166,7 @@ type inviteForm struct {
|
||||
Role users.Role
|
||||
Modules map[string]users.Access
|
||||
Problem string
|
||||
SeatOffer bool // the owner may add a seat for them
|
||||
}
|
||||
|
||||
func (s *Server) usersPage(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -229,6 +230,7 @@ func (s *Server) userInvite(w http.ResponseWriter, r *http.Request) {
|
||||
// to this one, with the account they have.
|
||||
if _, err := users.MembershipOf(s.platform(), s.team(), old.ID); err == nil || !s.multi() || old.Kind != users.Person {
|
||||
f.Problem = "Someone has that email address already: they're in the list below."
|
||||
} else if f.Problem, f.SeatOffer = s.seatCheck(r, v, true); f.Problem != "" {
|
||||
} else {
|
||||
if err := s.addExisting(v, old, role, mods, time.Now()); err != nil {
|
||||
s.serverError(w, err)
|
||||
@@ -243,6 +245,9 @@ func (s *Server) userInvite(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if f.Problem == "" {
|
||||
f.Problem, f.SeatOffer = s.seatCheck(r, v, true)
|
||||
}
|
||||
if f.Problem != "" {
|
||||
s.renderUsers(w, r, v, f, http.StatusUnprocessableEntity)
|
||||
return
|
||||
@@ -432,6 +437,10 @@ func (s *Server) userAction(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
case "enable":
|
||||
if problem, _ := s.seatCheck(r, v, false); problem != "" {
|
||||
s.renderUser(w, r, v, u, m, problem, http.StatusUnprocessableEntity)
|
||||
return
|
||||
}
|
||||
status := users.Active
|
||||
if !u.HasPassword {
|
||||
status = users.Invited // never joined: invite them again
|
||||
|
||||
Reference in New Issue
Block a user