This example demonstrates the restrictions on access to entries of the same directory for different user roles using the built-in platform mechanism (RLS).
You can download this configuration to explore the 1С platform:
Download (*.dt)
Also, you can study the instructions for developing from scratch.