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

Function roles_path

paperflow/roles.py:29–36  ·  view source on GitHub ↗

Resolve the role metadata file used to map role names to user ids.

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

Source from the content-addressed store, hash-verified

27
28
29def roles_path(*, project_root: Optional[Path] = None) -> Path:
30 """Resolve the role metadata file used to map role names to user ids."""
31 root = project_root or PROJECT_ROOT
32 configured = os.environ.get("PAPERFLOW_ROLES_PATH", "").strip()
33 if configured:
34 path = Path(configured).expanduser()
35 return path if path.is_absolute() else root / path
36 if project_root is not None:
37 # An explicit root is a deliberate override (tests, tooling); respect it.
38 return root / "data" / "roles.json"
39 # Otherwise resolve via the runtime root so an installed wheel does not

Callers 1

load_roles_metaFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected