I am looking at implementing role based access control using X-Pack on a document level. From the documentation, a role could be defined for my document like this:
{ "indices": [ { "names": [ "events-*" ], "privileges": [ "read" ], "query": "{"term": {"tags": "blog","sub-tags": "games","year": 2017 }}" } ]
}
For the query part, is it possible to extract the attributes "sub-tags" and "year" and place them in a template like Year_Game so that the query becomes like this:
{ "indices": [ { "names": [ "events-*" ], "privileges": [ "read" ], "query": "{"term": {"tags": "blog","Year_Game.sub-tags": "games","Year_Game.year": 2017 }}" } ]
}
The purpose is to simplify the administrator's task of creating roles so that they can simply re-use existing templates to create new roles.
How could I do this in X-pack?