Append the role/user storage label unless role subdirectories are disabled.
(path: Path, user_id: str, *, project_root: Optional[Path] = None)
| 80 | """Whether exported local files should be grouped by role/user label.""" |
| 81 | return env_flag("PAPERFLOW_STORAGE_ROLE_SUBDIR", default=True) |
| 82 | |
| 83 | |
| 84 | def 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 | |
| 89 | def 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 |
no test coverage detected