From caf546386d1bd78f6253dbe72757d7392f6a1811 Mon Sep 17 00:00:00 2001 From: wesleybl Date: Thu, 29 Aug 2024 09:53:24 -0300 Subject: [PATCH] Document `user` parameter in `restricted` function --- docs/source/development/how-to-restrict-blocks.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/development/how-to-restrict-blocks.md b/docs/source/development/how-to-restrict-blocks.md index 15fee224ed..0b2d83e79f 100644 --- a/docs/source/development/how-to-restrict-blocks.md +++ b/docs/source/development/how-to-restrict-blocks.md @@ -22,12 +22,13 @@ The function has this signature: block: BlockConfigBase; navRoot: Content; contentType: string; + user: Object }) => boolean; } ``` Where `properties` is the current object data and `block` is the block being evaluated in `BlockChooser`. -`navRoot` is the nearest navigation root object and `contentType` is the current content type. +`navRoot` is the nearest navigation root object and `contentType` is the current content type. `user` is an object that represents the currently authenticated user. In the following configuration example, you can restrict a block so that it cannot be added unless the content type is `News Item` or the content item is in a specific path in the content tree (`/folder`):