permission
#
THIS PACKAGE IS DEPRECATEDYou should be using the @iqmetrix/authorization for any new application. Please, also consider updating you old project to use the new package instead of @iqmetrix/permission
.
#
How to updateTo update from @iqmetrix/authorization
to @iqmetrix/authorization
is very simple and it can be done in 3 steps.
1 - Run the following command into you consolse
npm uninstall @iqmetrix/permission && npm i @iqmetrix/authorization
2 - Find all <Permission>
and </Permission>
and replace it with <Authorization>
and </Authorization>
respectively.
2.1 - If you are using the <PermissionToggle>
do the same as above and replace it with <AuthorizationToggle>
3 - Find all <PermissionContext>
and </PermissionContext>
and replace it with <AuthorizationContext>
and </AuthorizationContext>
respectively.
#
End of LifeThis package will be unpublished from Azure Artifacts on July 1st, 2020. Please, update your app by them or you will not be able to do new deploys.
#
The old packageThis packages offers a Permission
wrapper component that wraps an app or a specific component, and exposes permission props to its children via a Context Provider.
It also offers the PermissionToggle
(React Functional Component) that verifies your permissions and let you choose the behaviour for when the permission is granted
and when is notGranted
.
#
Installation#
Props#
PermissionName | Type | Required | Default |
---|---|---|---|
children | ReactNode | yes | undefined |
permissions | string[] | yes | undefined |
#
PermissionToggleName | Type | Required | Default |
---|---|---|---|
children | {granted: ReactNode , notGranted: ReactNode } | yes | undefined |
permissions | string[] | yes | undefined |