Description
Describe the Bug
It looks like the folder access controls behave slightly differently than other collections in the admin UI. For example, take a Media collection that has folders enabled. If both the Media and Folder collections have their access.update
set to return false
, when a single file is selected the UI removes the edit
action button, but when a single folder is selected the UI still displays the edit
action button. This should behave consistently.
Additionally, when a user attempts to move or delete a file/folder that they are unauthorized to act on, they can still click the action button, continue down the steps, and click the "submit" button to trigger the action. This actually results in a discrepancy where the UI displays a success toast, as where in reality the request failed and the action never completed.
Because of this, I believe:
- the
edit
action button on folder collections should be removed if the action is unauthorized - the
move
anddelete
action buttons on all collections should be removed if the action is unauthorized
Link to the code that reproduces this issue
https://github.com/kboicourt/payload-issue-reproduction
Reproduction Steps
(the reproduction repo is based off of a simple blank template project)
- navigate to the admin portal > media collection > By Folder
- create a new folder
- upload a new media file
- (clicking either a file or folder will show the actions available)
- (attempting to move or delete a file/folder will result in the success toast, but failing request)
Screen.Recording.2025-06-30.at.3.50.23.PM.mov
Which area(s) are affected? (Select all that apply)
area: ui
Environment Info
Binaries:
Node: 22.11.0
npm: 10.9.0
Yarn: 1.22.21
pnpm: 10.9.0
Relevant Packages:
payload: 3.44.0
next: 15.3.2
@payloadcms/db-mongodb: 3.44.0
@payloadcms/email-nodemailer: 3.44.0
@payloadcms/graphql: 3.44.0
@payloadcms/next/utilities: 3.44.0
@payloadcms/payload-cloud: 3.44.0
@payloadcms/richtext-lexical: 3.44.0
@payloadcms/translations: 3.44.0
@payloadcms/ui/shared: 3.44.0
react: 19.1.0
react-dom: 19.1.0
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:25 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6020
Available memory (MB): 65536
Available CPU cores: 12