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
Copy file name to clipboardExpand all lines: docs/AuthRBAC.md
+69-26Lines changed: 69 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -632,7 +632,11 @@ const ProductShow = () => (
632
632
633
633
Replacement for the `<TabbedShowLayout.Tab>` that only renders a tab if the user has the right permissions.
634
634
635
-
Add a `name` prop to the Tab to define the resource on which the user needs to have the 'read' permissions for.
635
+
Add a `name` prop to the `<Tab>` so you can reference it in the permissions.
636
+
Then, to allow users to access a particular `<Tab>`, update the permissions definition as follows: `{ action: 'read', resource: '{RESOURCE}.tab.{NAME}' }`, where `RESOURCE` is the resource name, and `NAME` the name you provided to the `<Tab>`.
637
+
638
+
> For instance, to allow users access to the following tab `<Tab label="Description" name="description">` in `products` resource, add this line in permissions: `{ action: 'read', resource: 'products.tab.description' }`.
639
+
636
640
637
641
`<Tab>` also only renders the child fields for which the user has the 'read' permissions.
638
642
@@ -651,7 +655,9 @@ const authProvider = {
651
655
// 'products.description' is missing
652
656
{ action:'read', resource:'products.thumbnail' },
653
657
// 'products.image' is missing
658
+
// note that the tab with the name 'description' will be displayed
Replacement for the default `<FormTab>` that only renders a tab if the user has the right permissions.
796
804
797
-
Add a `name` prop to the `FormTab` to define the sub-resource that the user needs to have the right permissions for.
805
+
Add a `name` prop to the `<FormTab>` so you can reference it in the permissions.
806
+
Then, to allow users to access a particular `<FormTab>`, update the permissions definition as follows: `{ action: 'write', resource: '{RESOURCE}.tab.{NAME}' }`, where `RESOURCE` is the resource name, and `NAME` the name you provided to the `<FormTab>`.
807
+
808
+
> For instance, to allow users access to the following tab `<FormTab label="Description" name="description">` in `products` resource, add this line in permissions: `{ action: 'write', resource: 'products.tab.description' }`.
798
809
799
810
`<FormTab>` also only renders the child inputs for which the user has the 'write' permissions.
Replacement for the default `<AccordionFormPanel>` that only renders a section if the user has the right permissions.
905
-
Add a `name` prop to the `AccordionFormPanel` to define the sub-resource that the user needs to have the right permissions for.
920
+
921
+
Add a `name` prop to the `<AccordionFormPanel>` so you can reference it in the permissions.
922
+
Then, to allow users to access a particular `<AccordionFormPanel>`, 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 `<FormTab>`.
923
+
924
+
> For instance, to allow users access to the following tab `<AccordionFormPanel label="Description" name="description">` in `products` resource, add this line in permissions: `{ action: 'write', resource: 'products.panel.description' }`.
925
+
906
926
`<AccordionFormPanel>` also only renders the child inputs for which the user has the 'write' permissions.
907
927
908
928
To learn more about the permissions format, please refer to the [`@react-admin/ra-rbac` documentation](https://marmelab.com/ra-enterprise/modules/ra-rbac).
Replacement for the default `<AccordionSection>` that only renders a section if the user has the right permissions.
958
-
Add a `name` prop to the `AccordionSection` to define the sub-resource that the user needs to have the right permissions for.
980
+
981
+
Add a `name` prop to the `<AccordionSection>` so you can reference it in the permissions.
982
+
Then, to allow users to access a particular `<AccordionSection>`, update the permissions definition as follows: `{ action: 'write', resource: '{RESOURCE}.section.{NAME}' }`, where `RESOURCE` is the resource name, and `NAME` the name you provided to the `<AccordionSection>`.
983
+
984
+
> For instance, to allow users access to the following tab `<AccordionSection label="Description" name="description">` in `products` resource, add this line in permissions: `{ action: 'write', resource: 'products.section.description' }`.
985
+
959
986
`<AccordionSection>` also only renders the child inputs for which the user has the 'write' permissions.
960
987
961
988
This component is provided by the `@react-admin/ra-enterprise` package.
Replacement for the default `<LongFormSection>` that only renders a section if the user has the right permissions.
1071
-
Add a `name` prop to the `LongFormSection` to define the sub-resource that the user needs to have the right permissions for.
1072
-
`<LongFormSection>` also only renders the child inputs for which the user has the 'write' 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.
1073
1103
1074
-
This component is provided by the `@react-admin/ra-enterprise` package.
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}.section.{NAME}' }`, where `RESOURCE` is the resource name, and `NAME` the name you provided to the `<LongForm.Section>`.
1106
+
1107
+
> For instance, to allow users access to the following tab `<LongForm.Section label="Description" name="description">` in `products` resource, add this line in permissions: `{ action: 'write', resource: 'products.section.description' }`.
1108
+
1109
+
`<LongForm.Section>` also only renders the child inputs for which the user has the 'write' permissions.
1075
1110
1076
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).
Replacement for the default `<WizardFormStep>` that only renders a step if the user has the right permissions.
1222
+
Replacement for the default `<WizardForm.Step>` that only renders a step if the user has the right permissions.
1184
1223
Use it with `<WizardForm>` from `@react-admin/ra-enterprise` to only display the steps the user has access to in the stepper.
1185
1224
1186
-
This component is provided by the `@react-admin/ra-enterprise` package.
1225
+
Add a `name` prop to the `<WizardForm.Step>` so you can reference it in the permissions.
1226
+
Then, to allow users to access a particular `<WizardForm.Step>`, update the permissions definition as follows: `{ action: 'write', resource: '{RESOURCE}.step.{NAME}' }`, where `RESOURCE` is the resource name, and `NAME` the name you provided to the `<WizardForm.Step>`.
1227
+
1228
+
> For instance, to allow users access to the following tab `<WizardForm.Step label="Description" name="description">` in `products` resource, add this line in permissions: `{ action: 'write', resource: 'products.step.description' }`.
1187
1229
1188
-
Add a `name` prop to the WizardFormStep to define the sub-resource that the user needs to have the right permissions for.
1189
-
`<WizardFormStep>` also only renders the child inputs for which the user has the 'write' permissions.
1230
+
`<WizardForm.Step>` also only renders the child inputs for which the user has the 'write' permissions.
1190
1231
1191
1232
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