MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / visibleCollectionIDs

Method visibleCollectionIDs

internal/server/server.go:2745–2751  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2743// handler, handleCreateItem's collection-visibility check, and every other
2744// direct caller) still granting a bearer admin an unrestricted view.
2745func (s *Server) visibleCollectionIDs(r *http.Request, workspaceID string) ([]string, error) {
2746 user := currentUser(r)
2747 if user == nil || (user.Role == "admin" && !isBearerAuth(r)) {
2748 return nil, nil // No filtering for admins (cookie session) or unauthenticated
2749 }
2750 return s.store.VisibleCollectionIDs(workspaceID, user.ID)
2751}
2752
2753// requireCollectionFullyVisible checks that the collection is visible to the
2754// requesting user under FULL-collection-access semantics (BUG-1920 —

Callers 15

handleExportAccountMethod · 0.95
handleGetItemLinksMethod · 0.95
handleDeleteItemLinkMethod · 0.95
handleListPlaybooksMethod · 0.95
handleShowPlaybookMethod · 0.95
handleRunPlaybookMethod · 0.95
handleListCollectionsMethod · 0.95

Calls 3

currentUserFunction · 0.85
isBearerAuthFunction · 0.85
VisibleCollectionIDsMethod · 0.80