Lets say there are resources like the files. Who, when, where have an access to the individual file is not a problem. Assume that there is a resource like a directory which has its own attributes and contain other files, directories and/or some other items. Now there is a user which have an access to a directory but does not have access (even to see the name/title) to some of the files or sub-diectories.
How to filter the directory to contain only the files which a user may access, if the policy decision is separated from a business logic. Should I check each file individually?
If yes then if the directory contains 10M files and user has access only to a couple of files how to identify that files?
First of all, you have to decide what the resource is: is it the folder, the file? The file from an abstract sense (meaning both folder and file)? Is it the case that you can view a file if and only if you can view its ancestors? In other words there is a hierarchy.
Putting these questions aside, there are two approaches you can take when it comes to access control on a large set of data: