MCPcopy Create free account
hub / github.com/dropbox/dbxcli / withRootNamespace

Function withRootNamespace

cmd/root.go:256–273  ·  view source on GitHub ↗
(cfg dropbox.Config, tokType string)

Source from the content-addressed store, hash-verified

254}
255
256func withRootNamespace(cfg dropbox.Config, tokType string) dropbox.Config {
257 // Team manage tokens are for administrative operations and don't need a path root.
258 if tokType == tokenTeamManage {
259 return cfg
260 }
261
262 account, err := usersNewFunc(cfg).GetCurrentAccountContext(currentContext())
263 if err != nil {
264 cfg.LogInfo("Warning: could not auto-detect root namespace (%v); team folders may not be accessible", err)
265 return cfg
266 }
267
268 rootNamespaceID := rootNamespaceID(account)
269 if rootNamespaceID == "" {
270 return cfg
271 }
272 return cfg.WithRoot(rootNamespaceID)
273}
274
275func rootNamespaceID(account *users.FullAccount) string {
276 if account == nil {

Calls 3

currentContextFunction · 0.85
rootNamespaceIDFunction · 0.85