You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replacement for the default `<LongFormSection>` that only renders a section if the user has the right permissions.
1101
+
Replacement for the default `<LongForm.Section>` that only renders a section if the user has the right permissions.
1102
+
Use it with `<LongForm>` from `@react-admin/ra-enterprise` to only display the section the user has access to in the form.
1102
1103
1103
-
Add a `name` prop to the `<LongFormSection>` so you can reference it in the permissions.
1104
-
Then, to allow users to access a particular `<LongFormSection>`, update the permissions definition as follows: `{ action: 'write', resource: '{RESOURCE}.panel.{NAME}' }`, where `RESOURCE` is the resource name, and `NAME` the name you provided to the `<LongFormSection>`.
1104
+
Add a `name` prop to the `<LongForm.Section>` so you can reference it in the permissions.
1105
+
Then, to allow users to access a particular `<LongForm.Section>`, update the permissions definition as follows: `{ action: 'write', resource: '{RESOURCE}.panel.{NAME}' }`, where `RESOURCE` is the resource name, and `NAME` the name you provided to the `<LongForm.Section>`.
1105
1106
1106
-
> For instance, to allow users access to the following tab `<LongFormSection label="Description" name="description">` in `product` resource, add this line in permissions: `{ action: 'write', resource: 'products.panel.description' }`.
1107
+
> For instance, to allow users access to the following tab `<LongForm.Section label="Description" name="description">` in `product` resource, add this line in permissions: `{ action: 'write', resource: 'products.panel.description' }`.
1107
1108
1108
-
`<LongFormSection>` also only renders the child inputs for which the user has the 'write' permissions.
1109
-
1110
-
This component is provided by the `@react-admin/ra-enterprise` package.
1109
+
`<LongForm.Section>` also only renders the child inputs for which the user has the 'write' permissions.
1111
1110
1112
1111
To learn more about the permissions format, please refer to the [`@react-admin/ra-rbac` documentation](https://marmelab.com/ra-enterprise/modules/ra-rbac).
0 commit comments