Search code examples
cakephpcomponentsaclauthentication

How to avoid unauthorized access to Files inside CakePHP's webroot folder using ACL?


I have a folder inside my CakePHP webroot folder, I want [ONLY] logged-in users to access this folder/files inside webroot! Is it possible?

For example:

If not logged in:

www.example.com/app/webroot/pdf/word.doc

This should yield a message saying please login


Solution

  • No, this is not possible because the access to the files in the webroot folder is not handled by the framework.

    The media view is probably what you are looking for.