Granting additional privileges
In the previous recipe, we learned how to create various custom roles with different privilege sets to manage multi-tenancy in the Elastic Stack. In this recipe, we will extend these roles to provide additional granularity that goes beyond basic RBAC. We will use field-level security and document-level security to demonstrate how to achieve more precise management of who can view and interact with different pieces of data.
Getting ready
Make sure you have completed the recipes in Chapter 6 and Chapter 10.
Make sure that you have completed the previous recipe, Defining custom roles.
The snippets in this recipe are available at the following link: https://github.com/PacktPublishing/Elastic-Stack-8.x-Cookbook/blob/main/Chapter11/snippets.md#granting-additional-privileges
How to do it…
We’ll now tighten security for the two roles that we created in the previous recipe: firstly, by applying field-level security to cookbook_business_reader...