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
+28-6Lines changed: 28 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -632,7 +632,7 @@ 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>` so you can reference it in the permissions.
635
+
Add a `name` prop to the `<Tab>` so you can reference it in the permissions.
636
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
637
638
638
> For instance, to allow users access to the following tab `<Tab label="Description" name="description">` in `product` resource, add this line in permissions: `{ action: 'read', resource: 'products.tab.description' }`.
@@ -802,7 +802,10 @@ const ProductEdit = () => (
802
802
803
803
Replacement for the default `<FormTab>` that only renders a tab if the user has the right permissions.
804
804
805
-
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 `product` resource, add this line in permissions: `{ action: 'write', resource: 'products.tab.description' }`.
806
809
807
810
`<FormTab>` also only renders the child inputs for which the user has the 'write' permissions.
808
811
@@ -914,7 +917,12 @@ const ProductEdit = () => (
914
917
### `<AccordionFormPanel>`
915
918
916
919
Replacement for the default `<AccordionFormPanel>` that only renders a section if the user has the right permissions.
917
-
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 `product` resource, add this line in permissions: `{ action: 'write', resource: 'products.panel.description' }`.
925
+
918
926
`<AccordionFormPanel>` also only renders the child inputs for which the user has the 'write' permissions.
919
927
920
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).
@@ -969,7 +977,12 @@ const ProductEdit = () => (
969
977
### `<AccordionSection>`
970
978
971
979
Replacement for the default `<AccordionSection>` that only renders a section if the user has the right permissions.
972
-
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 `product` resource, add this line in permissions: `{ action: 'write', resource: 'products.section.description' }`.
985
+
973
986
`<AccordionSection>` also only renders the child inputs for which the user has the 'write' permissions.
974
987
975
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.
1089
-
Add a `name` prop to the `LongFormSection` to define the sub-resource that the user needs to have the right permissions for.
1102
+
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>`.
1105
+
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
+
1090
1108
`<LongFormSection>` also only renders the child inputs for which the user has the 'write' permissions.
1091
1109
1092
1110
This component is provided by the `@react-admin/ra-enterprise` package.
@@ -1207,7 +1225,11 @@ Use it with `<WizardForm>` from `@react-admin/ra-enterprise` to only display the
1207
1225
1208
1226
This component is provided by the `@react-admin/ra-enterprise` package.
1209
1227
1210
-
Add a `name` prop to the WizardFormStep to define the sub-resource that the user needs to have the right permissions for.
1228
+
Add a `name` prop to the `<WizardFormStep>` so you can reference it in the permissions.
1229
+
Then, to allow users to access a particular `<WizardFormStep>`, 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 `<WizardFormStep>`.
1230
+
1231
+
> For instance, to allow users access to the following tab `<WizardFormStep label="Description" name="description">` in `product` resource, add this line in permissions: `{ action: 'write', resource: 'products.step.description' }`.
1232
+
1211
1233
`<WizardFormStep>` also only renders the child inputs for which the user has the 'write' permissions.
1212
1234
1213
1235
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