requireCollectionFullyVisible checks that the collection is visible to the requesting user under FULL-collection-access semantics (BUG-1920). This is deliberately STRICTER than handleGetCollection's inline visibleCollectionIDs + isCollectionVisible check: VisibleCollectionIDs (workspace_members.go)
(w http.ResponseWriter, r *http.Request, workspaceID string, coll *models.Collection)
| 3621 | // Writes a 404 and returns false if not visible; callers should invoke this |
| 3622 | // immediately after resolving a collection by slug/ID. |
| 3623 | func (s *Server) requireCollectionFullyVisible(w http.ResponseWriter, r *http.Request, workspaceID string, coll *models.Collection) bool { |
| 3624 | visible, err := s.checkCollectionFullyVisible(r, workspaceID, coll.ID) |
| 3625 | if err != nil { |
| 3626 | writeInternalError(w, err) |
| 3627 | return false |
| 3628 | } |
| 3629 | if !visible { |
| 3630 | writeError(w, http.StatusNotFound, "not_found", "Collection not found") |
| 3631 | return false |
| 3632 | } |
| 3633 | return true |
| 3634 | } |
| 3635 | |
| 3636 | // requireItemVisible checks that the item's collection is visible to the |
| 3637 | // requesting user. For guests with item-level grants, also verifies that the |
no test coverage detected