payloadcms / payloadcms/payload

Cannot prevent interaction with "Enable API Key" field

Open
#17,514 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: ui status: needs-triage v3
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

When the API Key Strategy is used on a collection, it's not possible, or at least not clear, to prevent users from interacting with the "Enable API Key" field. In the most extreme example completely blocking update access on the collection does not prevent interaction to this field like others:

access: {
  update: () => false,
},

While users without update access can't actually save the change by toggling the field, it's confusing that the interaction is even possible given everything else is disabled.

Link to the code that reproduces this issue

https://github.com/erikmartus/payload-api-field

Reproduction Steps
  1. After starting to the application, navigate to the Users collection and open any user.
  2. Click on the checkbox for the "Enable API Key" field, verify that it toggles displaying the API Key field.
  3. Attempt to edit any other field, verify that the field is disabled.
  4. Navigate away or refresh the page to verify that the change is not persisted.
Image Image
Which area(s) are affected?

area: ui

Environment Info
Binaries:
  Node: 25.9.0
  npm: 11.12.1
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  payload: 3.85.2
  next: 16.2.11
  @payloadcms/db-postgres: 3.85.2
  @payloadcms/drizzle: 3.85.2
  @payloadcms/graphql: 3.85.2
  @payloadcms/live-preview: 3.86.0
  @payloadcms/live-preview-react: 3.86.0
  @payloadcms/next/utilities: 3.85.2
  @payloadcms/plugin-cloud-storage: 3.85.2
  @payloadcms/richtext-lexical: 3.85.2
  @payloadcms/sdk: 3.85.2
  @payloadcms/storage-s3: 3.85.2
  @payloadcms/translations: 3.85.2
  @payloadcms/ui/shared: 3.85.2
  react: 19.2.7
  react-dom: 19.2.7
Operating System:
  Platform: linux
  Arch: arm64
  Version: #1 SMP Thu Jun 11 15:44:51 UTC 2026
  Available memory (MB): 3919
  Available CPU cores: 4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction repository and its Users collection configured with the API Key Strategy and update access set to false. Trace the admin UI entry point for the “Enable API Key” field, reproduce the interaction, and verify that the control’s behavior matches the collection’s update access restrictions.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, react, typescript
Domain
authorization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.