Skip to main content

mr group parents

Walk up the owner chain from a Group to its top-level ancestor. Returns an array of Group objects ordered from outermost ancestor down to the queried Group itself (so the last element is always the group you asked about, and root groups return a single-element array containing just themselves). The walk is bounded to 20 levels to defend against cycles in corrupted data.

Use this to render breadcrumbs or to detect whether a group lives under a particular root.

Usage​

mr group parents <id>

Positional arguments:

  • <id>

Examples​

Show the ancestor chain for group 42

mr group parents 42

Extract ancestor IDs as CSV

mr group parents 42 --json | jq -r 'map(.ID) | join(",")'

Flags​

This command has no local flags.

Inherited global flags​

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output​

Array of Group objects representing the ancestor chain (up to 20 levels deep), including the queried group itself

Exit Codes​

0 on success; 1 on any error

See Also​