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)
| 3679 | // Writes a 404 and returns false if not visible; callers should invoke this |
| 3680 | // immediately after resolving a collection by slug/ID. |
| 3681 | func (s *Server) requireCollectionFullyVisible(w http.ResponseWriter, r *http.Request, workspaceID string, coll *models.Collection) bool { |
| 3682 | visible, err := s.checkCollectionFullyVisible(r, workspaceID, coll.ID) |
| 3683 | if err != nil { |
| 3684 | writeInternalError(w, err) |
| 3685 | return false |
| 3686 | } |
| 3687 | if !visible { |
| 3688 | writeError(w, http.StatusNotFound, "not_found", "Collection not found") |
| 3689 | return false |
| 3690 | } |
| 3691 | return true |
| 3692 | } |
| 3693 | |
| 3694 | // requireItemVisible checks that the item's collection is visible to the |
| 3695 | // requesting user. For guests with item-level grants, also verifies that the |
no test coverage detected