Situation:
I have two documents: doc_parent (has access fields) and doc_file(public doc). doc_file has field "parent_unid"( with unid of doc_parent ) and field "$file" with attachment "file_name.doc"
User get attachment by link looks like: http://server/base/view/doc_file_unid/$file/file_name.docx.
I it possible to check current user access to doc_parent, when he makes this request?
You can't do it while directly accessing the $file object. You would have to have the access to the file go through an agent via a URL that looks something like this:
http://server/base/checkAccessAndRetriveFile?OpenAgent&fileunid=doc_file_unid/&filename=file_name.docx
And then you would have to write the agent and check the access fiends in doc_parent.
There is nothing built-in that you can rely on.
On the other hand, you could just have those access fields exist in both doc_parent and doc_file, and then none of this would be necessary.