Using _user.Roles in role template


(Jonathan Channon) #1

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


(Jonathan Channon) #2

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


(system) #3

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