Skip to content

bug(platform): Settings › API shows Access denied to a member with an API grant when their access read fails #4767

Closed

Description

@yannickmonney

Problem

Who is affected: members whose role isn't Owner, Admin or Developer, but who may use the API, either through a competence an Admin granted or because they still hold a personal key.

What they see: when either of their access reads fails, Settings › API shows an Access denied page instead of a failure:

Using API keys takes the Owner, Admin or Developer role, or a competence an Admin grants for one.

If only one read fails, a tab they may open is denied with "This page is for Owners, Admins and Developers." or the Models text instead.

Why it matters: the page states a verdict about their permissions that it never established, and it offers no Try again. A member who holds a key and wants to revoke it, for example after a leak, is told they may not open the page at all.

Cause

All paths below are at main d08251809.

  • services/platform/app/features/settings/model-endpoints/hooks/use-api-settings-access.ts:29-49:
    • It reads useMyModelApiAccess (governance/queries:getMyModelApiAccess) and useMyApiKeyAccess (governance/queries:getMyApiKeyAccess).
    • It keeps only data?.allowed, data?.mayCreate and data?.holdsKeys.
    • loading covers isLoading only, so a failed read becomes false access once loading ends.
  • services/platform/app/routes/dashboard/$id/settings/api/route.tsx:81-102:
    • after access.loading, visibleItems.length === 0 renders <AccessDenied message={tAccessDenied('apiKeys')} />;
    • tabDenied renders apiTab or apiModels.
    • There is no error branch, and the access interface has no error or refetch.
  • Who isn't affected: Owners, Admins and Developers, because developer comes from the ability, not from these reads.
  • History: the code dates from feat(platform): serve OpenAI- and Anthropic-compatible model endpoints #3812 and fix(platform): hold API-key creation to one rule, on the server #3941 (2026-09-29).

Expected

  • useApiSettingsAccess exposes error and retry for the two reads.
  • When a read the member's access depends on has failed, the layout shows a short failure, such as "Your API access didn't load.", with Try again. It never shows Access denied.
  • A partial failure keeps the tabs the successful read proves and names the failure for the rest.

Regression: route tests for a Member with a key grant, failing each read (500) in turn. They must show the failure with Try again, never accessDenied.apiKeys, apiTab or apiModels, and show the REST tab after a successful retry. Controls: a healthy grant shows REST, and a refused member still sees Access denied.

Severity and owner

Activity

  1. yannickmonney commented on Oct 12, 2026

    @yannickmonney
    ContributorAuthor

    Addendum (Review A, TALE-358, 2026-10-12 20:15 Zurich occurrence): the same failed access reads also hide the API entry from Settings navigation. main c94f1fd84, paths under services/platform/app/features/settings/.

    • model-endpoints/hooks/use-api-settings-access.ts:35-43 decides access from standing.data?.allowed === true and keys.data?.mayCreate/holdsKeys === true, so a failed read counts as "no access", as this issue describes for the page.
    • The settings rail uses the same hook (components/settings-rail.tsx:108-111) and hides the whole API group when none of the flags is true (:226, filtered at :270-279). The mobile settings list does the same (components/use-settings-menu-groups.ts:58-60, :147).
    • Effect: a member who was granted API keys or model access loses the API entry entirely when either read fails. No error or Try again appears, so they can't even reach the page this issue is about.

    Expected: while either grant read has failed, keep the entry, or show it with an error state, instead of treating the failure as no access.

    This is static reading, verified at the cited lines. I didn't run it.

  2. added
    agent-ready
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions