Elastic search query - parent child permissions

I have the following use case :

I have multiple folders each having associated accesses for users and teams.

Each folder is associated with multiple files
and inherits the folder permissions.

I want to query based on access from Elasticsearch.

I want to query only based on permissions. But for thousands of files inside a folder, I don't want to update all file document if folder permissions changes.

Permissions cannot be changed at file level only parent level.

I have parent folder ids stored inside the file document inside a array.

Is there any way I can query the files based on folder permission instead of storing permission at each file .

So that any update only occurs in parent document and rest all works seamlessly.

Note that is should work on both knn search as well as bm25.

Added vector-search

Added eql-elastic-query-language

Removed elastic-stack-security