`gitcabin sync link` tries to fetch `viewer_permission` from `/repos//`. That field doesn't exist on the REST endpoint — it's a GraphQL Repository.viewerPermission field. REST returns a `permissions` object with `{admin, maintain, push, triage, pull}` booleans for the authenticated user.
Current behavior: the lookup silently falls through to "READ" for every link, which then makes viewer_can_close_or_reopen wrong on synced items the user actually owns.
Fix: either query GraphQL for viewerPermission, or map the REST permissions object to a role string (admin → ADMIN, maintain → MAINTAIN, push → WRITE, triage → TRIAGE, pull → READ).
Also surface a way to override role manually via `gitcabin sync link --role ADMIN`, which already exists but the auto path needs to actually work.
`gitcabin sync link` tries to fetch `viewer_permission` from `/repos//`. That field doesn't exist on the REST endpoint — it's a GraphQL Repository.viewerPermission field. REST returns a `permissions` object with `{admin, maintain, push, triage, pull}` booleans for the authenticated user.
Current behavior: the lookup silently falls through to "READ" for every link, which then makes viewer_can_close_or_reopen wrong on synced items the user actually owns.
Fix: either query GraphQL for viewerPermission, or map the REST permissions object to a role string (admin → ADMIN, maintain → MAINTAIN, push → WRITE, triage → TRIAGE, pull → READ).
Also surface a way to override role manually via `gitcabin sync link --role ADMIN`, which already exists but the auto path needs to actually work.