Add granular access control to uploads, and image sizes #5333
doolle89
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 4 replies
-
I'm not sure I understand. Uploads collections have access control which you can do as with any other collections. For example, this would give you a collection that only users with a role of const Uploads: CollectionConfig = {
slug: 'uploads',
upload: true,
access: {
read: ({ req }) => req.user?.roles?.includes('admin')
},
fields: [],
} The static handler for reading files from the api calls on this access control to make sure requests are authorized for the content being requested. It is true that we don't have separate access control for imageSizes but you may be able to write that in a custom way using the incoming Let me know if I've missed something. We want this jto be as intuitive as possible. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Today we have very good Access Control for Collections and Fields, but there is no support for Access Control for Uploads, as stated in the documentation "All files that are uploaded to each Collection automatically support the read Access Control function from the Collection itself"
The problem is that Upload is not a Field and it has its own options but they don't have separate Access Control. Furthermore in case of images or files with previews it would be very useful to have Access Control for each size, so it is possible to define different access rights.
Beta Was this translation helpful? Give feedback.
All reactions