diff --git a/docs/reference/pages/panels.md b/docs/reference/pages/panels.md index e65e0a78c8..d7ddeb4057 100644 --- a/docs/reference/pages/panels.md +++ b/docs/reference/pages/panels.md @@ -37,6 +37,15 @@ Here are some built-in panel types that you can use in your panel definitions. T .. attribute:: FieldPanel.permission (optional) Allows a field to be selectively shown to users with sufficient permission. Accepts a permission codename such as ``'myapp.change_blog_category'`` - if the logged-in user does not have that permission, the field will be omitted from the form. See Django's documentation on :ref:`custom permissions ` for details on how to set permissions up; alternatively, if you want to set a field as only available to superusers, you can use any arbitrary string (such as ``'superuser'``) as the codename, since superusers automatically pass all permission tests. + + .. attribute:: FieldPanel.read_only (optional) + + Allows you to prevent a model field value from being set or updated by editors. + + For most field types, the field value will be rendered in the form for editors to see (along with field's label and help text), but no form inputs will be displayed, and the form will ignore attempts to change the value in POST data (e.g. by injecting a hidden input into the form HTML before submitting). + + By default, field values from ``StreamField`` or ``RichTextField`` are redacted to prevent rendering of potentially insecure HTML mid-form. You can change this behaviour for custom panel types by overriding ``Panel.format_value_for_display()``. + ``` ### MultiFieldPanel