Using _user.Roles in role template

I have the below query template in my role:

{"template":{"source":{"match":{"role.keyword","{{_user.roles}}"}}}}

role in that example is an array on a document. _user.roles is obviously an array.

When I log in as a user I see Discover: [script] failed to parse field [source] in Kibana which I assume to be an issue with the above template. Is what I'm trying to achieve possible which is the document can only be visible if one of the user roles matches any of the roles property on the document

I don't know if this addresses it? https://www.elastic.co/blog/attribute-based-access-control-with-xpack

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.