visibleCollectionIDs returns the set of collection IDs the current user can see in the given workspace. Returns nil if the user has "all" access (no filtering needed), or a non-nil slice for "specific" access. Unauthenticated users (fresh install) always get nil (all access), as do platform admins —
(r *http.Request, workspaceID string)
| 1923 | // handler, handleCreateItem's collection-visibility check, and every other |
| 1924 | // direct caller) still granting a bearer admin an unrestricted view. |
| 1925 | func (s *Server) visibleCollectionIDs(r *http.Request, workspaceID string) ([]string, error) { |
| 1926 | user := currentUser(r) |
| 1927 | if user == nil || (user.Role == "admin" && !isBearerAuth(r)) { |
| 1928 | return nil, nil // No filtering for admins (cookie session) or unauthenticated |
| 1929 | } |
| 1930 | return s.store.VisibleCollectionIDs(workspaceID, user.ID) |
| 1931 | } |
| 1932 | |
| 1933 | // requireCollectionFullyVisible checks that the collection is visible to the |
| 1934 | // requesting user under FULL-collection-access semantics (BUG-1920 — |
no test coverage detected