Drupal 8: How to use hook_entity_access() to let anonymous user upload private file

by shaghayegh jamei   Last Updated December 20, 2017 04:07 AM

I have same issue as : How to skip the ReferenceAccess constraint on a file upload by an anonymous user?

So I need to use hook_entity_access() or hook_ENTITY_TYPE_access() to solve the issue, but I don't know what code to use inside the hook.

Related Questions

"View private files" permission not effective

Updated April 12, 2015 00:03 AM

8 - Anonymous users can't access to image style field

Updated November 23, 2017 10:07 AM