I am building a system where users have specific dynamic roles which give them access to some resources (i.e meta documents). Those documents META are indexed with Elastic Search.
I can do my queries without trouble.
Now I need to take roles into account: If I add the roles allowed to see a given document while indexing docs I would then filter my query to match a particular role and return the results.
That is fine but if a role is changed I need to reindex all my documents.
If i do it dynamically on the server side 开发者_Go百科on reception of the Elastic Search result It may work as well but will consume some CPU and bandwidth, plus it may be a problem with facet searches and pagination.
How would you solve such a problem? What is the most suitable solution?
What about putting proxy in front you Elastic Search, that will remove all unwanted results and do not care about the roles the Search at all ?
精彩评论