MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / apply_user_scope

Function apply_user_scope

paperflow/roles.py:82–89  ·  view source on GitHub ↗

Append the role/user storage label unless role subdirectories are disabled.

(path: Path, user_id: str, *, project_root: Optional[Path] = None)

Source from the content-addressed store, hash-verified

80 """Whether exported local files should be grouped by role/user label."""
81 return env_flag("PAPERFLOW_STORAGE_ROLE_SUBDIR", default=True)
82
83
84def category_storage_subdir_enabled() -> bool:
85 """Whether exported local files should be grouped by output category."""
86 return env_flag("PAPERFLOW_STORAGE_CATEGORY_SUBDIR", default=True)
87
88
89def apply_user_scope(path: Path, user_id: str, *, project_root: Optional[Path] = None) -> Path:
90 """Append the role/user storage label unless role subdirectories are disabled."""
91 if not role_storage_subdir_enabled() or not str(user_id or "").strip():
92 return path

Callers 1

apply_output_scopeFunction · 0.85

Calls 2

Tested by

no test coverage detected