Skip to content

Commit

Permalink
Document user parameter in restricted function
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleybl committed Aug 29, 2024
1 parent 34364ac commit caf5463
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/source/development/how-to-restrict-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`):

Expand Down

0 comments on commit caf5463

Please sign in to comment.