Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apiKey field not fully customizable #8785

Closed
mikecebul opened this issue Oct 18, 2024 · 2 comments
Closed

apiKey field not fully customizable #8785

mikecebul opened this issue Oct 18, 2024 · 2 comments
Assignees
Labels

Comments

@mikecebul
Copy link

mikecebul commented Oct 18, 2024

Describe the Bug

Paul had an improvement with #7591, but I am unable to apply read access control on enableAPIKey and apiKey. I can prevent use if I set

{
      name: 'enableAPIKey',
      type: 'checkbox',
      access: {
        update: () => false,
      },
    },
    {
      name: 'apiKey',
      type: 'text',
      access: {
        update: () => false,
      },
    },

but the fields are still there and it looks like you can save, but it just immediately reverts. I would prefer to completely hide from all users accept my superAdmin.

Link to the code that reproduces this issue

n/a

Reproduction Steps

  1. add
  auth: {
    useAPIKey: true,
  },
  1. attempt to hide fields with access control.

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Binaries:
Node: 20.14.0
npm: 10.7.0
Yarn: N/A
pnpm: 9.7.0
Relevant Packages:
payload: 3.0.0-beta.116
next: 15.0.0-canary.173
@payloadcms/email-resend: 3.0.0-beta.116
@payloadcms/graphql: 3.0.0-beta.116
@payloadcms/live-preview: 3.0.0-beta.116
@payloadcms/live-preview-react: 3.0.0-beta.116
@payloadcms/next/utilities: 3.0.0-beta.116
@payloadcms/plugin-cloud-storage: 3.0.0-beta.116
@payloadcms/plugin-form-builder: 3.0.0-beta.116
@payloadcms/plugin-redirects: 3.0.0-beta.116
@payloadcms/plugin-seo: 3.0.0-beta.116
@payloadcms/plugin-stripe: 3.0.0-beta.116
@payloadcms/richtext-lexical: 3.0.0-beta.116
@payloadcms/storage-s3: 3.0.0-beta.116
@payloadcms/translations: 3.0.0-beta.116
@payloadcms/ui/shared: 3.0.0-beta.116
react: 19.0.0-rc-3edc000d-20240926
react-dom: 19.0.0-rc-3edc000d-20240926
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64
Available memory (MB): 8192
Available CPU cores: 8

@mikecebul mikecebul added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Oct 18, 2024
@paulpopus paulpopus self-assigned this Oct 18, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Oct 18, 2024
@jmikrut jmikrut assigned kendelljoseph and unassigned paulpopus Oct 29, 2024
@kendelljoseph
Copy link
Contributor

PR is open that addresses this. You can now use the read permission or the update permission and expect admin visuals to match.

Copy link

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants