@punch-in/strapi-admin 3.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +23 -0
- package/admin/src/app.js +242 -0
- package/admin/src/assets/icons/icon_auth-permissions.svg +1 -0
- package/admin/src/assets/icons/icon_content-manager.svg +1 -0
- package/admin/src/assets/icons/icon_content-type-builder.svg +1 -0
- package/admin/src/assets/icons/icon_settings-manager.svg +1 -0
- package/admin/src/assets/icons/icon_success.svg +19 -0
- package/admin/src/assets/images/background_empty.svg +1 -0
- package/admin/src/assets/images/background_welcome_homepage.png +0 -0
- package/admin/src/assets/images/banner_strapi-rocket.png +0 -0
- package/admin/src/assets/images/banner_t-shirt.png +0 -0
- package/admin/src/assets/images/bg_hp_tee_shirt.png +0 -0
- package/admin/src/assets/images/logo-strapi.png +0 -0
- package/admin/src/assets/images/logo-t-shirt.svg +1 -0
- package/admin/src/assets/images/logo_github.png +0 -0
- package/admin/src/assets/images/logo_slack.png +0 -0
- package/admin/src/assets/images/logo_stack_overflow.png +0 -0
- package/admin/src/assets/images/logo_strapi.png +0 -0
- package/admin/src/assets/images/oops.png +0 -0
- package/admin/src/assets/images/social_discord.png +0 -0
- package/admin/src/assets/images/social_gh.png +0 -0
- package/admin/src/assets/images/social_reddit.png +0 -0
- package/admin/src/assets/images/social_strapi.png +0 -0
- package/admin/src/assets/images/social_twitter.png +0 -0
- package/admin/src/components/BaselineAlignement/index.js +33 -0
- package/admin/src/components/Bloc/index.js +9 -0
- package/admin/src/components/ContainerFluid/index.js +13 -0
- package/admin/src/components/Fonts/index.js +76 -0
- package/admin/src/components/FormBloc/index.js +60 -0
- package/admin/src/components/FullWidthButton/index.js +15 -0
- package/admin/src/components/GlobalStyle/index.js +175 -0
- package/admin/src/components/Header/index.js +40 -0
- package/admin/src/components/HeaderSearch/HeaderSearch.js +8 -0
- package/admin/src/components/HeaderSearch/index.js +99 -0
- package/admin/src/components/IntlInput/index.js +38 -0
- package/admin/src/components/LeftMenu/LeftMenuFooter/Wrapper.js +51 -0
- package/admin/src/components/LeftMenu/LeftMenuFooter/index.js +44 -0
- package/admin/src/components/LeftMenu/LeftMenuHeader/Wrapper.js +51 -0
- package/admin/src/components/LeftMenu/LeftMenuHeader/index.js +14 -0
- package/admin/src/components/LeftMenu/LeftMenuLink/A.js +39 -0
- package/admin/src/components/LeftMenu/LeftMenuLink/LeftMenuIcon.js +23 -0
- package/admin/src/components/LeftMenu/LeftMenuLink/LeftMenuLinkContent.js +97 -0
- package/admin/src/components/LeftMenu/LeftMenuLink/NotificationCount.js +32 -0
- package/admin/src/components/LeftMenu/LeftMenuLink/index.js +41 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkHeader/Search.js +11 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkHeader/SearchButton.js +11 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkHeader/SearchWrapper.js +11 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkHeader/Title.js +30 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkHeader/index.js +81 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkHeader/messages.json +38 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkSection/EmptyLinksList.js +21 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkSection/EmptyLinksListWrapper.js +9 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkSection/LeftMenuListLink.js +10 -0
- package/admin/src/components/LeftMenu/LeftMenuLinkSection/index.js +84 -0
- package/admin/src/components/LeftMenu/LinksContainer/index.js +31 -0
- package/admin/src/components/LeftMenu/index.js +4 -0
- package/admin/src/components/NavTopRightWrapper/index.js +11 -0
- package/admin/src/components/Notifications/Notification/Li.js +168 -0
- package/admin/src/components/Notifications/Notification/index.js +104 -0
- package/admin/src/components/Notifications/NotificationsContainer/Wrapper.js +17 -0
- package/admin/src/components/Notifications/NotificationsContainer/index.js +56 -0
- package/admin/src/components/Notifications/index.js +2 -0
- package/admin/src/components/PageTitle/index.js +15 -0
- package/admin/src/components/Roles/ButtonWithNumber/NumberCard.js +10 -0
- package/admin/src/components/Roles/ButtonWithNumber/index.js +42 -0
- package/admin/src/components/Roles/CheckboxWithCondition/index.js +41 -0
- package/admin/src/components/Roles/Chevron/index.js +11 -0
- package/admin/src/components/Roles/CollapseLabel/index.js +11 -0
- package/admin/src/components/Roles/ConditionsButton/Wrapper.js +28 -0
- package/admin/src/components/Roles/ConditionsButton/index.js +49 -0
- package/admin/src/components/Roles/ConditionsModal/ActionRow/Wrapper.js +12 -0
- package/admin/src/components/Roles/ConditionsModal/ActionRow/index.js +88 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/ClearIndicator.js +15 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/CustomDropdownIndicator.js +39 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/IndicatorSeparator.js +3 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/MenuList/SubUl.js +48 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/MenuList/Ul.js +80 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/MenuList/UpperFirst.js +6 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/MenuList/index.js +140 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/MenuList/utils/constants.js +3 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/MenuList/utils/createCollapsesObject.js +14 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/SingleValue.js +46 -0
- package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/index.js +67 -0
- package/admin/src/components/Roles/ConditionsModal/Separator.js +9 -0
- package/admin/src/components/Roles/ConditionsModal/index.js +150 -0
- package/admin/src/components/Roles/ConditionsModal/utils/createDefaultConditionsForm.js +47 -0
- package/admin/src/components/Roles/ConditionsModal/utils/selectStyle.js +95 -0
- package/admin/src/components/Roles/ContentTypeCollapse/Collapse/Wrapper.js +38 -0
- package/admin/src/components/Roles/ContentTypeCollapse/Collapse/index.js +156 -0
- package/admin/src/components/Roles/ContentTypeCollapse/Collapse/utils/constants.js +3 -0
- package/admin/src/components/Roles/ContentTypeCollapse/Collapse/utils/generateCheckboxesActions.js +55 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/Wrapper.js +28 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/index.js +162 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/utils/constants.js +3 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/utils/getRowLabelCheckboxeState.js +59 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/Header/index.js +65 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/SubActionRow/Wrapper.js +8 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/SubActionRow/index.js +176 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/SubActionRow/row.js +37 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/SubActionRow/timeline.js +15 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/SubActionRow/utils/constants.js +3 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/Wrapper.js +21 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/index.js +55 -0
- package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/utils/generateHeadersFromActions.js +12 -0
- package/admin/src/components/Roles/ContentTypeCollapse/Wrapper.js +17 -0
- package/admin/src/components/Roles/ContentTypeCollapse/index.js +72 -0
- package/admin/src/components/Roles/ContentTypeCollapse/utils/activeStyle.js +15 -0
- package/admin/src/components/Roles/ContentTypeCollapse/utils/getAvailableActions.js +10 -0
- package/admin/src/components/Roles/ContentTypeCollapse/utils/index.js +2 -0
- package/admin/src/components/Roles/ContentTypeCollapses/index.js +50 -0
- package/admin/src/components/Roles/ContentTypes/Wrapper.js +13 -0
- package/admin/src/components/Roles/ContentTypes/index.js +39 -0
- package/admin/src/components/Roles/Curve/index.js +35 -0
- package/admin/src/components/Roles/EmptyRole/index.js +31 -0
- package/admin/src/components/Roles/GlobalActions/Wrapper.js +18 -0
- package/admin/src/components/Roles/GlobalActions/index.js +66 -0
- package/admin/src/components/Roles/GlobalActions/utils/constants.js +3 -0
- package/admin/src/components/Roles/GlobalActions/utils/findDisplayedActions.js +4 -0
- package/admin/src/components/Roles/GlobalActions/utils/getRowLabelCheckboxesState.js +38 -0
- package/admin/src/components/Roles/GlobalActions/utils/index.js +2 -0
- package/admin/src/components/Roles/HiddenAction/index.js +9 -0
- package/admin/src/components/Roles/Permissions/README.md +372 -0
- package/admin/src/components/Roles/Permissions/index.js +155 -0
- package/admin/src/components/Roles/Permissions/init.js +41 -0
- package/admin/src/components/Roles/Permissions/reducer.js +177 -0
- package/admin/src/components/Roles/Permissions/utils/createDefaultCTFormFromLayout.js +178 -0
- package/admin/src/components/Roles/Permissions/utils/createDefaultPluginsFormFromLayout.js +49 -0
- package/admin/src/components/Roles/Permissions/utils/findMatchingPermissions.js +4 -0
- package/admin/src/components/Roles/Permissions/utils/formatContentTypesPermissionToAPI.js +122 -0
- package/admin/src/components/Roles/Permissions/utils/formatLayoutForSettingsAndPlugins.js +23 -0
- package/admin/src/components/Roles/Permissions/utils/formatPermissionsToAPI.js +21 -0
- package/admin/src/components/Roles/Permissions/utils/formatSettingsPermissionsToAPI.js +59 -0
- package/admin/src/components/Roles/Permissions/utils/tabLabels.js +24 -0
- package/admin/src/components/Roles/Permissions/utils/updateConditionsToFalse.js +39 -0
- package/admin/src/components/Roles/Permissions/utils/updateValues.js +31 -0
- package/admin/src/components/Roles/PermissionsDataManagerProvider/index.js +26 -0
- package/admin/src/components/Roles/PluginsAndSettings/ListWrapper.js +10 -0
- package/admin/src/components/Roles/PluginsAndSettings/Row/Wrapper.js +28 -0
- package/admin/src/components/Roles/PluginsAndSettings/Row/index.js +82 -0
- package/admin/src/components/Roles/PluginsAndSettings/SubCategory/CheckboxWrapper.js +22 -0
- package/admin/src/components/Roles/PluginsAndSettings/SubCategory/ConditionsButtonWrapper.js +13 -0
- package/admin/src/components/Roles/PluginsAndSettings/SubCategory/Wrapper.js +26 -0
- package/admin/src/components/Roles/PluginsAndSettings/SubCategory/index.js +136 -0
- package/admin/src/components/Roles/PluginsAndSettings/SubCategory/utils/constants.js +3 -0
- package/admin/src/components/Roles/PluginsAndSettings/SubCategory/utils/formatActions.js +32 -0
- package/admin/src/components/Roles/PluginsAndSettings/SubCategory/utils/getConditionsButtonState.js +17 -0
- package/admin/src/components/Roles/PluginsAndSettings/SubCategory/utils/index.js +2 -0
- package/admin/src/components/Roles/PluginsAndSettings/index.js +53 -0
- package/admin/src/components/Roles/RequiredSign/index.js +11 -0
- package/admin/src/components/Roles/RoleForm/NameInput.js +6 -0
- package/admin/src/components/Roles/RoleForm/RoleForm.js +94 -0
- package/admin/src/components/Roles/RoleForm/index.js +2 -0
- package/admin/src/components/Roles/RoleList/RoleDescription.js +9 -0
- package/admin/src/components/Roles/RoleList/RoleListWrapper.js +17 -0
- package/admin/src/components/Roles/RoleList/RoleRow.js +48 -0
- package/admin/src/components/Roles/RoleList/index.js +3 -0
- package/admin/src/components/Roles/RowLabelWithCheckbox/Wrapper.js +29 -0
- package/admin/src/components/Roles/RowLabelWithCheckbox/index.js +76 -0
- package/admin/src/components/Roles/Tabs/Tab.js +22 -0
- package/admin/src/components/Roles/Tabs/TabsWrapper.js +17 -0
- package/admin/src/components/Roles/Tabs/index.js +65 -0
- package/admin/src/components/Roles/index.js +6 -0
- package/admin/src/components/Roles/utils/createArrayOfValues.js +19 -0
- package/admin/src/components/Roles/utils/getCheckboxState.js +19 -0
- package/admin/src/components/Roles/utils/index.js +3 -0
- package/admin/src/components/Roles/utils/removeConditionKeyFromData.js +15 -0
- package/admin/src/components/Settings/Header/index.js +71 -0
- package/admin/src/components/Settings/index.js +2 -0
- package/admin/src/components/SettingsPageTitle/index.js +17 -0
- package/admin/src/components/SizedInput/index.js +25 -0
- package/admin/src/components/UpgradePlanModal/components/Arrow/arrow.png +0 -0
- package/admin/src/components/UpgradePlanModal/components/Arrow/index.js +16 -0
- package/admin/src/components/UpgradePlanModal/components/Download/index.js +13 -0
- package/admin/src/components/UpgradePlanModal/components/Option/Wrapper.js +12 -0
- package/admin/src/components/UpgradePlanModal/components/Option/index.js +18 -0
- package/admin/src/components/UpgradePlanModal/components/Wrapper/balloon.png +0 -0
- package/admin/src/components/UpgradePlanModal/components/Wrapper/index.js +14 -0
- package/admin/src/components/UpgradePlanModal/components/index.js +4 -0
- package/admin/src/components/UpgradePlanModal/index.js +76 -0
- package/admin/src/components/Users/Filter/index.js +41 -0
- package/admin/src/components/Users/FilterPicker/Button.js +14 -0
- package/admin/src/components/Users/FilterPicker/Card/Input.js +35 -0
- package/admin/src/components/Users/FilterPicker/Card/Wrapper.js +8 -0
- package/admin/src/components/Users/FilterPicker/Card/index.js +91 -0
- package/admin/src/components/Users/FilterPicker/Card/init.js +5 -0
- package/admin/src/components/Users/FilterPicker/Card/reducer.js +39 -0
- package/admin/src/components/Users/FilterPicker/Card/utils/form.js +57 -0
- package/admin/src/components/Users/FilterPicker/Card/utils/formatInputValue.js +9 -0
- package/admin/src/components/Users/FilterPicker/Card/utils/getInputValue.js +9 -0
- package/admin/src/components/Users/FilterPicker/Card/utils/index.js +3 -0
- package/admin/src/components/Users/FilterPicker/index.js +35 -0
- package/admin/src/components/Users/Footer/Wrapper.js +7 -0
- package/admin/src/components/Users/Footer/index.js +40 -0
- package/admin/src/components/Users/LinkNotification/Envelope.js +20 -0
- package/admin/src/components/Users/LinkNotification/IconWrapper.js +15 -0
- package/admin/src/components/Users/LinkNotification/Wrapper.js +26 -0
- package/admin/src/components/Users/LinkNotification/index.js +47 -0
- package/admin/src/components/Users/List/ActiveStatus.js +20 -0
- package/admin/src/components/Users/List/Wrapper.js +34 -0
- package/admin/src/components/Users/List/index.js +151 -0
- package/admin/src/components/Users/List/init.js +5 -0
- package/admin/src/components/Users/List/reducer.js +56 -0
- package/admin/src/components/Users/List/utils/checkIfAllEntriesAreSelected.js +3 -0
- package/admin/src/components/Users/List/utils/getSelectedIds.js +19 -0
- package/admin/src/components/Users/List/utils/headers.js +42 -0
- package/admin/src/components/Users/List/utils/index.js +4 -0
- package/admin/src/components/Users/List/utils/updateRows.js +6 -0
- package/admin/src/components/Users/MagicLink/index.js +27 -0
- package/admin/src/components/Users/ModalCreateBody/Wrapper.js +12 -0
- package/admin/src/components/Users/ModalCreateBody/index.js +153 -0
- package/admin/src/components/Users/ModalCreateBody/init.js +5 -0
- package/admin/src/components/Users/ModalCreateBody/reducer.js +27 -0
- package/admin/src/components/Users/ModalCreateBody/utils/form.js +29 -0
- package/admin/src/components/Users/ModalCreateBody/utils/formDataModel.js +8 -0
- package/admin/src/components/Users/ModalCreateBody/utils/roleSettingsForm.js +10 -0
- package/admin/src/components/Users/ModalCreateBody/utils/schema.js +17 -0
- package/admin/src/components/Users/RoleSettingsModalSection/RolesSelectComponent.js +53 -0
- package/admin/src/components/Users/RoleSettingsModalSection/index.js +76 -0
- package/admin/src/components/Users/SelectRoles/ClearIndicator.js +15 -0
- package/admin/src/components/Users/SelectRoles/DropdownIndicator.js +39 -0
- package/admin/src/components/Users/SelectRoles/ErrorMessage.js +10 -0
- package/admin/src/components/Users/SelectRoles/IndicatorSeparator.js +3 -0
- package/admin/src/components/Users/SelectRoles/MultiValueContainer.js +43 -0
- package/admin/src/components/Users/SelectRoles/StyledOption.js +11 -0
- package/admin/src/components/Users/SelectRoles/index.js +68 -0
- package/admin/src/components/Users/SelectRoles/utils/styles.js +99 -0
- package/admin/src/components/Users/SortPicker/Button.js +14 -0
- package/admin/src/components/Users/SortPicker/List.js +46 -0
- package/admin/src/components/Users/SortPicker/ListItem.js +37 -0
- package/admin/src/components/Users/SortPicker/ListWrapper.js +18 -0
- package/admin/src/components/Users/SortPicker/StyledListItem.js +30 -0
- package/admin/src/components/Users/SortPicker/index.js +34 -0
- package/admin/src/components/Users/index.js +8 -0
- package/admin/src/components/Webhooks/EventInput/EventRow.js +66 -0
- package/admin/src/components/Webhooks/EventInput/Wrapper.js +77 -0
- package/admin/src/components/Webhooks/EventInput/index.js +128 -0
- package/admin/src/components/Webhooks/EventInput/utils/formatValue.js +13 -0
- package/admin/src/components/Webhooks/HeadersInput/Wrapper.js +102 -0
- package/admin/src/components/Webhooks/HeadersInput/index.js +143 -0
- package/admin/src/components/Webhooks/HeadersInput/keys.js +39 -0
- package/admin/src/components/Webhooks/HeadersInput/utils/getBorderColor.js +12 -0
- package/admin/src/components/Webhooks/Inputs/Wrapper.js +34 -0
- package/admin/src/components/Webhooks/Inputs/index.js +110 -0
- package/admin/src/components/Webhooks/ListRow/StyledListRow.js +49 -0
- package/admin/src/components/Webhooks/ListRow/index.js +113 -0
- package/admin/src/components/Webhooks/Switch/Toggle.js +30 -0
- package/admin/src/components/Webhooks/Switch/Wrapper.js +67 -0
- package/admin/src/components/Webhooks/Switch/index.js +51 -0
- package/admin/src/components/Webhooks/TriggerContainer/Wrapper.js +64 -0
- package/admin/src/components/Webhooks/TriggerContainer/index.js +103 -0
- package/admin/src/components/Webhooks/index.js +4 -0
- package/admin/src/config.js +13 -0
- package/admin/src/configureStore.js +60 -0
- package/admin/src/containers/Admin/Content.js +30 -0
- package/admin/src/containers/Admin/Logout/components.js +128 -0
- package/admin/src/containers/Admin/Logout/index.js +60 -0
- package/admin/src/containers/Admin/Wrapper.js +27 -0
- package/admin/src/containers/Admin/actions.js +21 -0
- package/admin/src/containers/Admin/constants.js +9 -0
- package/admin/src/containers/Admin/index.js +364 -0
- package/admin/src/containers/Admin/reducer.js +39 -0
- package/admin/src/containers/Admin/selectors.js +22 -0
- package/admin/src/containers/App/actions.js +87 -0
- package/admin/src/containers/App/components.js +15 -0
- package/admin/src/containers/App/constants.js +18 -0
- package/admin/src/containers/App/index.js +158 -0
- package/admin/src/containers/App/reducer.js +86 -0
- package/admin/src/containers/App/selectors.js +38 -0
- package/admin/src/containers/App/styles/website.css +25 -0
- package/admin/src/containers/App/utils/customRoutes.js +3 -0
- package/admin/src/containers/App/utils/defaultRoutes.js +3 -0
- package/admin/src/containers/App/utils/index.js +3 -0
- package/admin/src/containers/App/utils/routes.js +4 -0
- package/admin/src/containers/App/utils/unique-identifier.js +10 -0
- package/admin/src/containers/ApplicationInfosPage/components/Detail/index.js +30 -0
- package/admin/src/containers/ApplicationInfosPage/components/InfoText/index.js +19 -0
- package/admin/src/containers/ApplicationInfosPage/components/Link/components.js +22 -0
- package/admin/src/containers/ApplicationInfosPage/components/Link/index.js +26 -0
- package/admin/src/containers/ApplicationInfosPage/components/Wrapper/index.js +7 -0
- package/admin/src/containers/ApplicationInfosPage/components/index.js +4 -0
- package/admin/src/containers/ApplicationInfosPage/index.js +89 -0
- package/admin/src/containers/AuthPage/components/AuthLink/Link.js +13 -0
- package/admin/src/containers/AuthPage/components/AuthLink/Wrapper.js +8 -0
- package/admin/src/containers/AuthPage/components/AuthLink/index.js +35 -0
- package/admin/src/containers/AuthPage/components/Box/Wrapper.js +13 -0
- package/admin/src/containers/AuthPage/components/Box/index.js +28 -0
- package/admin/src/containers/AuthPage/components/ForgotPassword/index.js +65 -0
- package/admin/src/containers/AuthPage/components/ForgotPasswordSuccess/Envelope.js +20 -0
- package/admin/src/containers/AuthPage/components/ForgotPasswordSuccess/index.js +77 -0
- package/admin/src/containers/AuthPage/components/Input/index.js +32 -0
- package/admin/src/containers/AuthPage/components/Login/BaseLogin.js +84 -0
- package/admin/src/containers/AuthPage/components/Login/index.js +23 -0
- package/admin/src/containers/AuthPage/components/Logo/Img.js +7 -0
- package/admin/src/containers/AuthPage/components/Logo/index.js +7 -0
- package/admin/src/containers/AuthPage/components/Oops/Img.js +7 -0
- package/admin/src/containers/AuthPage/components/Oops/index.js +63 -0
- package/admin/src/containers/AuthPage/components/Register/CustomLabel.js +28 -0
- package/admin/src/containers/AuthPage/components/Register/InputWrapper.js +8 -0
- package/admin/src/containers/AuthPage/components/Register/Span.js +13 -0
- package/admin/src/containers/AuthPage/components/Register/index.js +173 -0
- package/admin/src/containers/AuthPage/components/ResetPassword/index.js +73 -0
- package/admin/src/containers/AuthPage/components/Section/index.js +22 -0
- package/admin/src/containers/AuthPage/index.js +321 -0
- package/admin/src/containers/AuthPage/init.js +5 -0
- package/admin/src/containers/AuthPage/reducer.js +41 -0
- package/admin/src/containers/AuthPage/utils/forms.js +124 -0
- package/admin/src/containers/AuthPage/utils/index.js +2 -0
- package/admin/src/containers/HomePage/BlogPost.js +48 -0
- package/admin/src/containers/HomePage/SocialLink.js +52 -0
- package/admin/src/containers/HomePage/components.js +260 -0
- package/admin/src/containers/HomePage/hooks.js +54 -0
- package/admin/src/containers/HomePage/index.js +239 -0
- package/admin/src/containers/InstalledPluginsPage/ListWrapper.js +7 -0
- package/admin/src/containers/InstalledPluginsPage/Logo.js +36 -0
- package/admin/src/containers/InstalledPluginsPage/Row.js +98 -0
- package/admin/src/containers/InstalledPluginsPage/index.js +73 -0
- package/admin/src/containers/InstalledPluginsPage/utils/generateRows.js +19 -0
- package/admin/src/containers/LanguageProvider/actions.js +16 -0
- package/admin/src/containers/LanguageProvider/constants.js +8 -0
- package/admin/src/containers/LanguageProvider/hooks/useChangeLanguage.js +14 -0
- package/admin/src/containers/LanguageProvider/index.js +49 -0
- package/admin/src/containers/LanguageProvider/reducer.js +52 -0
- package/admin/src/containers/LanguageProvider/selectors.js +25 -0
- package/admin/src/containers/LeftMenu/Loader.js +34 -0
- package/admin/src/containers/LeftMenu/LoaderWrapper.js +13 -0
- package/admin/src/containers/LeftMenu/Wrapper.js +61 -0
- package/admin/src/containers/LeftMenu/actions.js +24 -0
- package/admin/src/containers/LeftMenu/constants.js +4 -0
- package/admin/src/containers/LeftMenu/index.js +101 -0
- package/admin/src/containers/LeftMenu/reducer.js +79 -0
- package/admin/src/containers/LeftMenu/selectors.js +3 -0
- package/admin/src/containers/LeftMenu/useMenuSections.js +62 -0
- package/admin/src/containers/LeftMenu/utils/checkPermissions.js +13 -0
- package/admin/src/containers/LeftMenu/utils/generateModelsLinks.js +61 -0
- package/admin/src/containers/LeftMenu/utils/getCtOrStLinks.js +49 -0
- package/admin/src/containers/LeftMenu/utils/getGeneralLinks.js +42 -0
- package/admin/src/containers/LeftMenu/utils/getPluginSectionLinks.js +17 -0
- package/admin/src/containers/LeftMenu/utils/getSettingsMenuLinksPermissions.js +20 -0
- package/admin/src/containers/LeftMenu/utils/index.js +2 -0
- package/admin/src/containers/LeftMenu/utils/toPluginLinks.js +19 -0
- package/admin/src/containers/LocaleToggle/Wrapper.js +147 -0
- package/admin/src/containers/LocaleToggle/actions.js +19 -0
- package/admin/src/containers/LocaleToggle/constants.js +8 -0
- package/admin/src/containers/LocaleToggle/index.js +84 -0
- package/admin/src/containers/LocaleToggle/reducer.js +25 -0
- package/admin/src/containers/LocaleToggle/selectors.js +25 -0
- package/admin/src/containers/MarketplacePage/MarketplaceBanner/Wrapper.js +29 -0
- package/admin/src/containers/MarketplacePage/MarketplaceBanner/index.js +37 -0
- package/admin/src/containers/MarketplacePage/PluginCard/Wrapper.js +148 -0
- package/admin/src/containers/MarketplacePage/PluginCard/index.js +184 -0
- package/admin/src/containers/MarketplacePage/Wrapper.js +10 -0
- package/admin/src/containers/MarketplacePage/index.js +103 -0
- package/admin/src/containers/NewNotification/Notification/index.js +181 -0
- package/admin/src/containers/NewNotification/Notification/styledComponents.js +66 -0
- package/admin/src/containers/NewNotification/Wrapper.js +19 -0
- package/admin/src/containers/NewNotification/actions.js +9 -0
- package/admin/src/containers/NewNotification/constants.js +2 -0
- package/admin/src/containers/NewNotification/index.js +35 -0
- package/admin/src/containers/NewNotification/reducer.js +49 -0
- package/admin/src/containers/NotFoundPage/index.js +24 -0
- package/admin/src/containers/NotificationProvider/actions.js +37 -0
- package/admin/src/containers/NotificationProvider/constants.js +8 -0
- package/admin/src/containers/NotificationProvider/index.js +45 -0
- package/admin/src/containers/NotificationProvider/reducer.js +48 -0
- package/admin/src/containers/NotificationProvider/selectors.js +27 -0
- package/admin/src/containers/Onboarding/Li.js +150 -0
- package/admin/src/containers/Onboarding/StaticLinks/StyledLink.js +23 -0
- package/admin/src/containers/Onboarding/StaticLinks/index.js +45 -0
- package/admin/src/containers/Onboarding/Video.js +180 -0
- package/admin/src/containers/Onboarding/Wrapper.js +131 -0
- package/admin/src/containers/Onboarding/index.js +134 -0
- package/admin/src/containers/Onboarding/init.js +5 -0
- package/admin/src/containers/Onboarding/reducer.js +62 -0
- package/admin/src/containers/Onboarding/utils/formatAndStoreVideoArray.js +27 -0
- package/admin/src/containers/PermissionsManager/actions.js +25 -0
- package/admin/src/containers/PermissionsManager/constants.js +5 -0
- package/admin/src/containers/PermissionsManager/index.js +49 -0
- package/admin/src/containers/PermissionsManager/reducer.js +66 -0
- package/admin/src/containers/PluginDispatcher/index.js +69 -0
- package/admin/src/containers/PrivateRoute/index.js +39 -0
- package/admin/src/containers/ProfilePage/components.js +9 -0
- package/admin/src/containers/ProfilePage/index.js +160 -0
- package/admin/src/containers/ProfilePage/utils/form.js +36 -0
- package/admin/src/containers/ProfilePage/utils/index.js +2 -0
- package/admin/src/containers/ProfilePage/utils/schema.js +6 -0
- package/admin/src/containers/Roles/CreatePage/index.js +8 -0
- package/admin/src/containers/Roles/EditPage/index.js +172 -0
- package/admin/src/containers/Roles/EditPage/utils/schema.js +8 -0
- package/admin/src/containers/Roles/ListPage/BaselineAlignment.js +8 -0
- package/admin/src/containers/Roles/ListPage/index.js +149 -0
- package/admin/src/containers/Roles/ProtectedEditPage/index.js +31 -0
- package/admin/src/containers/Roles/ProtectedListPage/index.js +12 -0
- package/admin/src/containers/SettingsHeaderSearchContextProvider/index.js +17 -0
- package/admin/src/containers/SettingsPage/components/ApplicationDetailLink/Icon.js +13 -0
- package/admin/src/containers/SettingsPage/components/ApplicationDetailLink/Link.js +25 -0
- package/admin/src/containers/SettingsPage/components/ApplicationDetailLink/Notif.js +17 -0
- package/admin/src/containers/SettingsPage/components/ApplicationDetailLink/Wrapper.js +9 -0
- package/admin/src/containers/SettingsPage/components/ApplicationDetailLink/index.js +26 -0
- package/admin/src/containers/SettingsPage/components/MenuWrapper/index.js +9 -0
- package/admin/src/containers/SettingsPage/components/SettingDispatcher/index.js +27 -0
- package/admin/src/containers/SettingsPage/components/StyledLeftMenu/index.js +13 -0
- package/admin/src/containers/SettingsPage/components/Wrapper/index.js +19 -0
- package/admin/src/containers/SettingsPage/components/index.js +5 -0
- package/admin/src/containers/SettingsPage/index.js +132 -0
- package/admin/src/containers/SettingsPage/utils/createPluginsLinksRoutes.js +23 -0
- package/admin/src/containers/SettingsPage/utils/createRoute.js +8 -0
- package/admin/src/containers/SettingsPage/utils/customRoutes.js +3 -0
- package/admin/src/containers/SettingsPage/utils/defaultRoutes.js +65 -0
- package/admin/src/containers/SettingsPage/utils/findFirstAllowedEndpoint.js +14 -0
- package/admin/src/containers/SettingsPage/utils/getSectionsToDisplay.js +5 -0
- package/admin/src/containers/SettingsPage/utils/index.js +6 -0
- package/admin/src/containers/SettingsPage/utils/makeUniqueRoutes.js +6 -0
- package/admin/src/containers/SettingsPage/utils/routes.js +4 -0
- package/admin/src/containers/Theme/index.js +14 -0
- package/admin/src/containers/Users/EditPage/index.js +137 -0
- package/admin/src/containers/Users/EditPage/utils/form.js +52 -0
- package/admin/src/containers/Users/ListPage/Header.js +78 -0
- package/admin/src/containers/Users/ListPage/ModalForm.js +101 -0
- package/admin/src/containers/Users/ListPage/index.js +289 -0
- package/admin/src/containers/Users/ListPage/init.js +3 -0
- package/admin/src/containers/Users/ListPage/reducer.js +57 -0
- package/admin/src/containers/Users/ListPage/stepper.js +18 -0
- package/admin/src/containers/Users/ListPage/utils/getFilters.js +30 -0
- package/admin/src/containers/Users/ProtectedEditPage/index.js +45 -0
- package/admin/src/containers/Users/ProtectedListPage/index.js +12 -0
- package/admin/src/containers/Webhooks/EditView/Wrapper.js +61 -0
- package/admin/src/containers/Webhooks/EditView/index.js +448 -0
- package/admin/src/containers/Webhooks/EditView/reducer.js +76 -0
- package/admin/src/containers/Webhooks/EditView/utils/fieldsRegex.js +4 -0
- package/admin/src/containers/Webhooks/EditView/utils/form.js +38 -0
- package/admin/src/containers/Webhooks/EditView/utils/formatData.js +26 -0
- package/admin/src/containers/Webhooks/EditView/utils/index.js +3 -0
- package/admin/src/containers/Webhooks/EditView/utils/schema.js +38 -0
- package/admin/src/containers/Webhooks/ListView/Wrapper.js +31 -0
- package/admin/src/containers/Webhooks/ListView/index.js +320 -0
- package/admin/src/containers/Webhooks/ListView/reducer.js +43 -0
- package/admin/src/containers/Webhooks/ProtectedCreateView/index.js +12 -0
- package/admin/src/containers/Webhooks/ProtectedEditView/index.js +12 -0
- package/admin/src/containers/Webhooks/ProtectedListView/index.js +12 -0
- package/admin/src/contexts/MarketPlace/index.js +25 -0
- package/admin/src/contexts/PermisssionsDataManagerContext/index.js +5 -0
- package/admin/src/contexts/SettingsHeaderSearchContext/index.js +5 -0
- package/admin/src/contexts/index.js +2 -0
- package/admin/src/favicon.png +0 -0
- package/admin/src/hooks/index.js +9 -0
- package/admin/src/hooks/useFetchPermissionsLayout/index.js +32 -0
- package/admin/src/hooks/useFetchPermissionsLayout/reducer.js +35 -0
- package/admin/src/hooks/useFetchPluginsFromMarketPlace/index.js +49 -0
- package/admin/src/hooks/useFetchRole/index.js +58 -0
- package/admin/src/hooks/useFetchRole/reducer.js +33 -0
- package/admin/src/hooks/useModels/index.js +47 -0
- package/admin/src/hooks/useModels/reducer.js +45 -0
- package/admin/src/hooks/usePermissionsDataManager/index.js +6 -0
- package/admin/src/hooks/useRolesList/index.js +49 -0
- package/admin/src/hooks/useRolesList/init.js +5 -0
- package/admin/src/hooks/useRolesList/reducer.js +31 -0
- package/admin/src/hooks/useSettingsForm/index.js +136 -0
- package/admin/src/hooks/useSettingsForm/init.js +5 -0
- package/admin/src/hooks/useSettingsForm/reducer.js +60 -0
- package/admin/src/hooks/useSettingsHeaderSearchContext/index.js +6 -0
- package/admin/src/hooks/useSettingsMenu/index.js +56 -0
- package/admin/src/hooks/useSettingsMenu/init.js +49 -0
- package/admin/src/hooks/useSettingsMenu/reducer.js +41 -0
- package/admin/src/hooks/useSettingsMenu/utils/customGlobalLinks.js +1 -0
- package/admin/src/hooks/useSettingsMenu/utils/defaultGlobalLinks.js +14 -0
- package/admin/src/hooks/useSettingsMenu/utils/formatLinks.js +12 -0
- package/admin/src/hooks/useSettingsMenu/utils/globalLinks.js +4 -0
- package/admin/src/i18n.js +17 -0
- package/admin/src/index.html +16 -0
- package/admin/src/permissions/customPermissions.js +1 -0
- package/admin/src/permissions/defaultPermissions.js +60 -0
- package/admin/src/permissions/index.js +7 -0
- package/admin/src/plugins.js +37 -0
- package/admin/src/public-path.js +40 -0
- package/admin/src/reducers.js +28 -0
- package/admin/src/themes/colors.js +51 -0
- package/admin/src/themes/fontWeights.js +8 -0
- package/admin/src/themes/index.js +13 -0
- package/admin/src/themes/sizes.js +31 -0
- package/admin/src/translations/ar.json +146 -0
- package/admin/src/translations/cs.json +183 -0
- package/admin/src/translations/de.json +371 -0
- package/admin/src/translations/dk.json +348 -0
- package/admin/src/translations/en.json +374 -0
- package/admin/src/translations/es.json +338 -0
- package/admin/src/translations/fr.json +232 -0
- package/admin/src/translations/he.json +364 -0
- package/admin/src/translations/id.json +337 -0
- package/admin/src/translations/index.js +86 -0
- package/admin/src/translations/it.json +347 -0
- package/admin/src/translations/ja.json +288 -0
- package/admin/src/translations/ko.json +179 -0
- package/admin/src/translations/ms.json +223 -0
- package/admin/src/translations/nl.json +221 -0
- package/admin/src/translations/no.json +349 -0
- package/admin/src/translations/pl.json +372 -0
- package/admin/src/translations/pt-BR.json +228 -0
- package/admin/src/translations/pt.json +225 -0
- package/admin/src/translations/ru.json +368 -0
- package/admin/src/translations/sk.json +337 -0
- package/admin/src/translations/sv.json +127 -0
- package/admin/src/translations/th.json +332 -0
- package/admin/src/translations/tr.json +371 -0
- package/admin/src/translations/uk.json +223 -0
- package/admin/src/translations/vi.json +179 -0
- package/admin/src/translations/zh-Hans.json +371 -0
- package/admin/src/translations/zh.json +152 -0
- package/admin/src/utils/ComponentApi.js +42 -0
- package/admin/src/utils/FieldApi.js +48 -0
- package/admin/src/utils/MiddlewareApi.js +15 -0
- package/admin/src/utils/Plugin.js +50 -0
- package/admin/src/utils/Strapi.js +28 -0
- package/admin/src/utils/basename.js +3 -0
- package/admin/src/utils/checkFormValidity.js +15 -0
- package/admin/src/utils/checkLatestStrapiVersion.js +11 -0
- package/admin/src/utils/checkStore.js +24 -0
- package/admin/src/utils/constants.js +3 -0
- package/admin/src/utils/formatAPIErrors.js +17 -0
- package/admin/src/utils/getAttributesToDisplay.js +21 -0
- package/admin/src/utils/getExistingActions.js +34 -0
- package/admin/src/utils/getRequestUrl.js +3 -0
- package/admin/src/utils/history.js +6 -0
- package/admin/src/utils/index.js +9 -0
- package/admin/src/utils/injectReducer.js +56 -0
- package/admin/src/utils/injectSaga.js +76 -0
- package/admin/src/utils/reducerInjectors.js +38 -0
- package/admin/src/utils/retrieveGlobalLinks.js +17 -0
- package/admin/src/utils/retrievePluginsMenu.js +17 -0
- package/admin/src/utils/sagaInjectors.js +94 -0
- package/admin/src/utils/sortLinks.js +5 -0
- package/admin/src/validations/users/edit.js +11 -0
- package/admin/src/validations/users/index.js +3 -0
- package/admin/src/validations/users/profile.js +29 -0
- package/admin/src/validations/users/roles.js +11 -0
- package/config/admin-actions.js +122 -0
- package/config/admin-conditions.js +26 -0
- package/config/email-templates/forgot-password.js +25 -0
- package/config/functions/bootstrap.js +67 -0
- package/config/functions/register.js +7 -0
- package/config/layout.js +10 -0
- package/config/migrations/permissions-fields-to-properties.js +104 -0
- package/config/policies/hasPermissions.js +51 -0
- package/config/policies/isAuthenticatedAdmin.js +9 -0
- package/config/routes.json +320 -0
- package/config/settings.js +9 -0
- package/controllers/Webhooks.js +164 -0
- package/controllers/admin.js +101 -0
- package/controllers/authenticated-user.js +43 -0
- package/controllers/authentication.js +181 -0
- package/controllers/formatters/conditions.js +12 -0
- package/controllers/formatters/format-actions-by-sections.js +37 -0
- package/controllers/formatters/index.js +9 -0
- package/controllers/permission.js +51 -0
- package/controllers/role.js +148 -0
- package/controllers/user.js +136 -0
- package/doc/change-the-login-page-logo.md +28 -0
- package/doc/customize-menu.md +17 -0
- package/doc/disable-tracking.md +16 -0
- package/domain/action/index.js +142 -0
- package/domain/action/provider.js +83 -0
- package/domain/condition/index.js +92 -0
- package/domain/condition/provider.js +42 -0
- package/domain/permission/index.js +140 -0
- package/domain/role.js +29 -0
- package/domain/user.js +25 -0
- package/ee/LICENSE +21 -0
- package/ee/admin/components/ProviderButton/ProviderButtonStyles.js +31 -0
- package/ee/admin/components/ProviderButton/index.js +42 -0
- package/ee/admin/components/Roles/ConditionsModal/ConditionsSelect/MenuList/utils/constants.js +3 -0
- package/ee/admin/components/Roles/ContentTypeCollapse/Collapse/utils/constants.js +3 -0
- package/ee/admin/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/utils/constants.js +3 -0
- package/ee/admin/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/SubActionRow/utils/constants.js +3 -0
- package/ee/admin/components/Roles/GlobalActions/utils/constants.js +3 -0
- package/ee/admin/components/Roles/PluginsAndSettings/SubCategory/utils/constants.js +3 -0
- package/ee/admin/components/Roles/RoleForm/index.js +72 -0
- package/ee/admin/components/Users/MagicLink/index.js +36 -0
- package/ee/admin/components/Users/ModalCreateBody/utils/formDataModel.js +14 -0
- package/ee/admin/components/Users/ModalCreateBody/utils/roleSettingsForm.js +21 -0
- package/ee/admin/containers/App/utils/customRoutes.js +11 -0
- package/ee/admin/containers/AuthPage/components/Login/index.js +88 -0
- package/ee/admin/containers/AuthPage/components/Providers/index.js +76 -0
- package/ee/admin/containers/AuthPage/utils/forms.js +16 -0
- package/ee/admin/containers/AuthResponse/index.js +62 -0
- package/ee/admin/containers/Roles/CreatePage/index.js +215 -0
- package/ee/admin/containers/Roles/CreatePage/utils/schema.js +8 -0
- package/ee/admin/containers/Roles/ListPage/BaselineAlignment.js +8 -0
- package/ee/admin/containers/Roles/ListPage/CustomCheckbox.js +12 -0
- package/ee/admin/containers/Roles/ListPage/RoleRow.js +99 -0
- package/ee/admin/containers/Roles/ListPage/index.js +260 -0
- package/ee/admin/containers/Roles/ListPage/reducer.js +60 -0
- package/ee/admin/containers/Roles/ProtectedListPage/index.js +12 -0
- package/ee/admin/containers/SettingsPage/SingleSignOn/index.js +113 -0
- package/ee/admin/containers/SettingsPage/SingleSignOn/utils/form.js +28 -0
- package/ee/admin/containers/SettingsPage/SingleSignOn/utils/index.js +2 -0
- package/ee/admin/containers/SettingsPage/SingleSignOn/utils/schema.js +11 -0
- package/ee/admin/containers/SettingsPage/utils/customRoutes.js +16 -0
- package/ee/admin/hooks/index.js +2 -0
- package/ee/admin/hooks/useAuthProviders/index.js +51 -0
- package/ee/admin/hooks/useAuthProviders/reducer.js +26 -0
- package/ee/admin/hooks/useSettingsMenu/utils/customGlobalLinks.js +18 -0
- package/ee/admin/permissions/customPermissions.js +11 -0
- package/ee/config/admin-actions.js +24 -0
- package/ee/config/functions/bootstrap.js +19 -0
- package/ee/config/routes.json +28 -0
- package/ee/controllers/authentication/constants.js +11 -0
- package/ee/controllers/authentication/index.js +11 -0
- package/ee/controllers/authentication/middlewares.js +114 -0
- package/ee/controllers/authentication/utils.js +23 -0
- package/ee/controllers/authentication.js +68 -0
- package/ee/controllers/permission.js +21 -0
- package/ee/controllers/role.js +116 -0
- package/ee/controllers/user.js +36 -0
- package/ee/middlewares/features-routes/defaults.json +5 -0
- package/ee/middlewares/features-routes/index.js +23 -0
- package/ee/middlewares/features-routes/routes.js +43 -0
- package/ee/services/passport/provider-registry.js +27 -0
- package/ee/services/passport/sso.js +25 -0
- package/ee/services/passport.js +32 -0
- package/ee/services/role.js +22 -0
- package/ee/validation/authentication.js +25 -0
- package/ee/validation/permission.js +16 -0
- package/ee/validation/role.js +77 -0
- package/ee/validation/user.js +29 -0
- package/index.html +16 -0
- package/index.js +374 -0
- package/middlewares/auth/defaults.json +5 -0
- package/middlewares/auth/index.js +39 -0
- package/models/Permission.js +7 -0
- package/models/Permission.settings.json +49 -0
- package/models/Role.js +7 -0
- package/models/Role.settings.json +50 -0
- package/models/User.js +7 -0
- package/models/User.settings.json +88 -0
- package/package.json +137 -0
- package/services/action.js +34 -0
- package/services/auth.js +113 -0
- package/services/condition.js +14 -0
- package/services/constants.js +12 -0
- package/services/content-type.js +206 -0
- package/services/metrics.js +16 -0
- package/services/passport/local-strategy.js +21 -0
- package/services/passport.js +47 -0
- package/services/permission/engine-hooks.js +82 -0
- package/services/permission/engine.js +275 -0
- package/services/permission/permissions-manager/index.js +85 -0
- package/services/permission/permissions-manager/query-builers.js +86 -0
- package/services/permission/queries.js +241 -0
- package/services/permission/sections-builder/builder.js +84 -0
- package/services/permission/sections-builder/handlers.js +154 -0
- package/services/permission/sections-builder/index.js +50 -0
- package/services/permission/sections-builder/section.js +71 -0
- package/services/permission/sections-builder/utils.js +26 -0
- package/services/permission.js +30 -0
- package/services/role.js +469 -0
- package/services/token.js +57 -0
- package/services/user.js +348 -0
- package/utils/index.js +11 -0
- package/validation/action-provider.js +85 -0
- package/validation/authentication/forgot-password.js +20 -0
- package/validation/authentication/index.js +17 -0
- package/validation/authentication/register.js +63 -0
- package/validation/authentication/reset-password.js +21 -0
- package/validation/common-functions/check-fields-are-correctly-nested.js +26 -0
- package/validation/common-functions/check-fields-dont-have-duplicates.js +16 -0
- package/validation/common-functions/index.js +9 -0
- package/validation/common-validators.js +214 -0
- package/validation/permission.js +153 -0
- package/validation/policies/hasPermissions.js +37 -0
- package/validation/role.js +21 -0
- package/validation/user.js +84 -0
- package/webpack.alias.js +64 -0
- package/webpack.config.js +212 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { curry, pipe, merge, set, pick, omit, includes, isArray, prop } = require('lodash/fp');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Domain representation of an Action (RBAC)
|
|
7
|
+
* @typedef {Object} Action
|
|
8
|
+
* @property {string} actionId - The unique identifier of the action
|
|
9
|
+
* @property {string} section - The section linked to the action
|
|
10
|
+
* @property {string} displayName - The human readable name of an action
|
|
11
|
+
* @property {string} category - The main category of an action
|
|
12
|
+
* @property {string} [subCategory] - The secondary category of an action (only for settings and plugins section)
|
|
13
|
+
* @property {string} [pluginName] - The plugin which provide the action
|
|
14
|
+
* @property {string[]} [subjects] - A list of subjects on which the action can be applied
|
|
15
|
+
* @property {Object} options - The options of an action
|
|
16
|
+
* @property {string[]} options.applyToProperties - The list of properties that can be associated with an action
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Set of attributes used to create a new {@link Action} object
|
|
21
|
+
* @typedef {Action, { uid: string }} CreateActionPayload
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Return the default attributes of a new {@link Action}
|
|
26
|
+
* @return Partial<Action>
|
|
27
|
+
*/
|
|
28
|
+
const getDefaultActionAttributes = () => ({
|
|
29
|
+
options: {
|
|
30
|
+
applyToProperties: null,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get the list of all the valid attributes of an {@link Action}
|
|
36
|
+
* @return {string[]}
|
|
37
|
+
*/
|
|
38
|
+
const actionFields = [
|
|
39
|
+
'section',
|
|
40
|
+
'displayName',
|
|
41
|
+
'category',
|
|
42
|
+
'subCategory',
|
|
43
|
+
'pluginName',
|
|
44
|
+
'subjects',
|
|
45
|
+
'options',
|
|
46
|
+
'actionId',
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Remove unwanted attributes from an {@link Action}
|
|
51
|
+
* @type {function(action: Action | CreateActionPayload): Action}
|
|
52
|
+
*/
|
|
53
|
+
const sanitizeActionAttributes = pick(actionFields);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Create and return an identifier for an {@link CreateActionPayload}.
|
|
57
|
+
* The format is based on the action's source ({@link CreateActionPayload.pluginName} or 'application') and {@link CreateActionPayload.uid}.
|
|
58
|
+
* @param {CreateActionPayload} attributes
|
|
59
|
+
* @return {string}
|
|
60
|
+
*/
|
|
61
|
+
const computeActionId = attributes => {
|
|
62
|
+
const { pluginName, uid } = attributes;
|
|
63
|
+
|
|
64
|
+
if (!pluginName) {
|
|
65
|
+
return `application::${uid}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (pluginName === 'admin') {
|
|
69
|
+
return `admin::${uid}`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return `plugins::${pluginName}.${uid}`;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Assign an actionId attribute to an {@link CreateActionPayload} object
|
|
77
|
+
* @param {CreateActionPayload} attrs - Payload used to create an action
|
|
78
|
+
* @return {CreateActionPayload}
|
|
79
|
+
*/
|
|
80
|
+
const assignActionId = attrs => set('actionId', computeActionId(attrs), attrs);
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Transform an action by adding or removing the {@link Action.subCategory} attribute
|
|
84
|
+
* @param {Action} action - The action to process
|
|
85
|
+
* @return {Action}
|
|
86
|
+
*/
|
|
87
|
+
const assignOrOmitSubCategory = action => {
|
|
88
|
+
const shouldHaveSubCategory = ['settings', 'plugins'].includes(action.section);
|
|
89
|
+
|
|
90
|
+
return shouldHaveSubCategory
|
|
91
|
+
? set('subCategory', action.subCategory || 'general', action)
|
|
92
|
+
: omit('subCategory', action);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Check if a property can be applied to an {@link Action}
|
|
97
|
+
* @type (function(property: string, action: Action): boolean) | (function(property: string): (function(action: Action): boolean))
|
|
98
|
+
* @return {boolean} Return true if the property can be applied for the given action
|
|
99
|
+
*/
|
|
100
|
+
const appliesToProperty = curry((property, action) => {
|
|
101
|
+
return pipe(prop('options.applyToProperties'), includes(property))(action);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Check if an action applies to a subject
|
|
106
|
+
* @param {string} subject
|
|
107
|
+
* @param {Action} action
|
|
108
|
+
* @return {boolean}
|
|
109
|
+
*/
|
|
110
|
+
const appliesToSubject = curry((subject, action) => {
|
|
111
|
+
return isArray(action.subjects) && includes(subject, action.subjects);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Transform the given attributes into a domain representation of an Action
|
|
116
|
+
* @type (function(payload: CreateActionPayload): Action)
|
|
117
|
+
* @param {CreateActionPayload} payload - The action payload containing the attributes needed to create an {@link Action}
|
|
118
|
+
* @return {Action} A newly created {@link Action}
|
|
119
|
+
*/
|
|
120
|
+
const create = pipe(
|
|
121
|
+
// Create and assign an action identifier to the action
|
|
122
|
+
// (need to be done before the sanitizeActionAttributes since we need the uid here)
|
|
123
|
+
assignActionId,
|
|
124
|
+
// Add or remove the sub category field based on the pluginName attribute
|
|
125
|
+
assignOrOmitSubCategory,
|
|
126
|
+
// Remove unwanted attributes from the payload
|
|
127
|
+
sanitizeActionAttributes,
|
|
128
|
+
// Complete the action creation by adding default values for some attributes
|
|
129
|
+
merge(getDefaultActionAttributes())
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
module.exports = {
|
|
133
|
+
actionFields,
|
|
134
|
+
appliesToProperty,
|
|
135
|
+
appliesToSubject,
|
|
136
|
+
assignActionId,
|
|
137
|
+
assignOrOmitSubCategory,
|
|
138
|
+
create,
|
|
139
|
+
computeActionId,
|
|
140
|
+
getDefaultActionAttributes,
|
|
141
|
+
sanitizeActionAttributes,
|
|
142
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { providerFactory, hooks } = require('strapi-utils');
|
|
4
|
+
const { validateRegisterProviderAction } = require('../../validation/action-provider');
|
|
5
|
+
const domain = require('./index');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef ActionProviderOverride
|
|
9
|
+
* @property {function(CreateActionPayload)} register
|
|
10
|
+
* @property {function(attributes CreateActionPayload[]): Promise<this>} registerMany
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new instance of an action provider
|
|
15
|
+
* @return {Provider & ActionProviderOverride}
|
|
16
|
+
*/
|
|
17
|
+
const createActionProvider = options => {
|
|
18
|
+
const provider = providerFactory(options);
|
|
19
|
+
const actionHooks = {
|
|
20
|
+
appliesPropertyToSubject: hooks.createAsyncParallelHook(),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
...provider,
|
|
25
|
+
|
|
26
|
+
hooks: {
|
|
27
|
+
...provider.hooks,
|
|
28
|
+
...actionHooks,
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
async register(actionAttributes) {
|
|
32
|
+
if (strapi.isLoaded) {
|
|
33
|
+
throw new Error(`You can't register new actions outside of the bootstrap function.`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
validateRegisterProviderAction([actionAttributes]);
|
|
37
|
+
|
|
38
|
+
const action = domain.create(actionAttributes);
|
|
39
|
+
|
|
40
|
+
return provider.register(action.actionId, action);
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
async registerMany(actionsAttributes) {
|
|
44
|
+
validateRegisterProviderAction(actionsAttributes);
|
|
45
|
+
|
|
46
|
+
for (const attributes of actionsAttributes) {
|
|
47
|
+
await this.register(attributes);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return this;
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
async appliesToProperty(property, actionId, subject) {
|
|
54
|
+
const action = provider.get(actionId);
|
|
55
|
+
const appliesToAction = domain.appliesToProperty(property, action);
|
|
56
|
+
|
|
57
|
+
// If the property isn't valid for this action, ignore the rest of the checks
|
|
58
|
+
if (!appliesToAction) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// If the property is valid for this action and there isn't any subject
|
|
63
|
+
if (!subject) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// If the property is valid for this action and the subject is not handled by the action
|
|
68
|
+
if (!domain.appliesToSubject(subject, action)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const results = await actionHooks.appliesPropertyToSubject.call({
|
|
73
|
+
property,
|
|
74
|
+
action,
|
|
75
|
+
subject,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return results.every(result => result !== false);
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
module.exports = createActionProvider;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { pipe, merge, set, pick } = require('lodash/fp');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The handler of a {@link Condition}
|
|
7
|
+
* @typedef {(function(user: Object, options: Object): Object | boolean)} ConditionHandler
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Domain representation of a Condition (RBAC)
|
|
11
|
+
* @typedef {Object} Condition
|
|
12
|
+
* @property {string} id - The identifier of the condition
|
|
13
|
+
* @property {string} displayName - The display name of a condition
|
|
14
|
+
* @property {string} name - The name of a condition
|
|
15
|
+
* @property {string} [plugin] - The plugin which provide the condition
|
|
16
|
+
* @property {string} [category] - The main category of a condition
|
|
17
|
+
* @property {ConditionHandler} handler - The handler of a condition
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Set of attributes used to create a new {@link Action} object
|
|
22
|
+
* @typedef {Condition, { uid: string }} CreateConditionPayload
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const DEFAULT_CATEGORY = 'default';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get the default value used for every condition
|
|
29
|
+
* @return {Condition}
|
|
30
|
+
*/
|
|
31
|
+
const getDefaultConditionAttributes = () => ({
|
|
32
|
+
category: DEFAULT_CATEGORY,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the list of all the valid attributes of a {@link Condition}
|
|
37
|
+
* @return {string[]}
|
|
38
|
+
*/
|
|
39
|
+
const conditionFields = ['id', 'displayName', 'handler', 'plugin', 'category'];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Remove unwanted attributes from a {@link Condition}
|
|
43
|
+
* @type {function(action: Condition | CreateConditionPayload): Condition}
|
|
44
|
+
*/
|
|
45
|
+
const sanitizeConditionAttributes = pick(conditionFields);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param condition
|
|
50
|
+
* @return {string}
|
|
51
|
+
*/
|
|
52
|
+
const computeConditionId = condition => {
|
|
53
|
+
const { name, plugin } = condition;
|
|
54
|
+
|
|
55
|
+
if (!plugin) {
|
|
56
|
+
return `application::${name}`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (plugin === 'admin') {
|
|
60
|
+
return `admin::${name}`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return `plugins::${plugin}.${name}`;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Assign an id attribute to a {@link CreateConditionPayload} object
|
|
68
|
+
* @param {CreateConditionPayload} attrs - Payload used to create a condition
|
|
69
|
+
* @return {CreateConditionPayload}
|
|
70
|
+
*/
|
|
71
|
+
const assignConditionId = attrs => set('id', computeConditionId(attrs), attrs);
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Transform the given attributes into a domain representation of a Condition
|
|
75
|
+
* @type (function(CreateConditionPayload): Condition)
|
|
76
|
+
* @param {CreateConditionPayload} payload - The condition payload containing the attributes needed to create a {@link Condition}
|
|
77
|
+
* @return {Condition}
|
|
78
|
+
*/
|
|
79
|
+
const create = pipe(
|
|
80
|
+
assignConditionId,
|
|
81
|
+
sanitizeConditionAttributes,
|
|
82
|
+
merge(getDefaultConditionAttributes())
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
module.exports = {
|
|
86
|
+
assignConditionId,
|
|
87
|
+
computeConditionId,
|
|
88
|
+
conditionFields,
|
|
89
|
+
create,
|
|
90
|
+
getDefaultConditionAttributes,
|
|
91
|
+
sanitizeConditionAttributes,
|
|
92
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { providerFactory } = require('strapi-utils');
|
|
4
|
+
const domain = require('./');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef ConditionProviderOverride
|
|
8
|
+
* @property {function(CreateConditionPayload)} register
|
|
9
|
+
* @property {function(attributes CreateConditionPayload[]): Promise<this>} registerMany
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new instance of a condition provider
|
|
14
|
+
* @return {Provider & ConditionProviderOverride}
|
|
15
|
+
*/
|
|
16
|
+
const createConditionProvider = () => {
|
|
17
|
+
const provider = providerFactory();
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
...provider,
|
|
21
|
+
|
|
22
|
+
async register(conditionAttributes) {
|
|
23
|
+
if (strapi.isLoaded) {
|
|
24
|
+
throw new Error(`You can't register new conditions outside of the bootstrap function.`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const condition = domain.create(conditionAttributes);
|
|
28
|
+
|
|
29
|
+
return provider.register(condition.id, condition);
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
async registerMany(conditionsAttributes) {
|
|
33
|
+
for (const attributes of conditionsAttributes) {
|
|
34
|
+
await this.register(attributes);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return this;
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
module.exports = createConditionProvider;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
pipe,
|
|
5
|
+
set,
|
|
6
|
+
pick,
|
|
7
|
+
eq,
|
|
8
|
+
omit,
|
|
9
|
+
remove,
|
|
10
|
+
get,
|
|
11
|
+
uniq,
|
|
12
|
+
isArray,
|
|
13
|
+
map,
|
|
14
|
+
curry,
|
|
15
|
+
merge,
|
|
16
|
+
} = require('lodash/fp');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Domain representation of a Permission (RBAC)
|
|
20
|
+
* @typedef {Object} Permission
|
|
21
|
+
* @property {string} [id] - The unique identifier of the permission
|
|
22
|
+
* @property {string} [role] - The role associated to a permission
|
|
23
|
+
* @property {string} action - The human readable name of an action
|
|
24
|
+
* @property {string} properties - A set of properties used to define the permission with more granularity
|
|
25
|
+
* @property {string} conditions - Conditions to check when evaluating the permission
|
|
26
|
+
* @property {string} subject - The subject on which the permission should applies
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
const permissionFields = ['id', 'action', 'subject', 'properties', 'conditions', 'role'];
|
|
30
|
+
const sanitizedPermissionFields = ['id', 'action', 'subject', 'properties', 'conditions'];
|
|
31
|
+
|
|
32
|
+
const sanitizePermissionFields = pick(sanitizedPermissionFields);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Creates a permission with default values
|
|
36
|
+
* @return {Permission}
|
|
37
|
+
*/
|
|
38
|
+
const getDefaultPermission = () => ({
|
|
39
|
+
conditions: [],
|
|
40
|
+
properties: {},
|
|
41
|
+
subject: null,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Returns a new permission with the given condition
|
|
46
|
+
* @param {string} condition - The condition to add
|
|
47
|
+
* @param {Permission} permission - The permission on which we want to add the condition
|
|
48
|
+
* @return {Permission}
|
|
49
|
+
*/
|
|
50
|
+
const addCondition = curry((condition, permission) => {
|
|
51
|
+
const { conditions } = permission;
|
|
52
|
+
const newConditions = Array.isArray(conditions)
|
|
53
|
+
? uniq(conditions.concat(condition))
|
|
54
|
+
: [condition];
|
|
55
|
+
|
|
56
|
+
return set('conditions', newConditions, permission);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Returns a new permission without the given condition
|
|
61
|
+
* @param {string} condition - The condition to remove
|
|
62
|
+
* @param {Permission} permission - The permission on which we want to remove the condition
|
|
63
|
+
* @return {Permission}
|
|
64
|
+
*/
|
|
65
|
+
const removeCondition = curry((condition, permission) => {
|
|
66
|
+
return set('conditions', remove(eq(condition), permission.conditions), permission);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Gets a property or a part of a property from a permission.
|
|
71
|
+
* @param {string} property - The property to get
|
|
72
|
+
* @param {Permission} permission - The permission on which we want to access the property
|
|
73
|
+
* @return {Permission}
|
|
74
|
+
*/
|
|
75
|
+
const getProperty = curry((property, permission) => get(`properties.${property}`, permission));
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Set a value for a given property on a new permission object
|
|
79
|
+
* @param {string} property - The name of the property
|
|
80
|
+
* @param {any} value - The value of the property
|
|
81
|
+
* @param {Permission} permission - The permission on which we want to set the property
|
|
82
|
+
* @return {Permission}
|
|
83
|
+
*/
|
|
84
|
+
const setProperty = (property, value, permission) => {
|
|
85
|
+
return set(`properties.${property}`, value, permission);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Returns a new permission without the given property name set
|
|
90
|
+
* @param {string} property - The name of the property to delete
|
|
91
|
+
* @param {Permission} permission - The permission on which we want to remove the property
|
|
92
|
+
* @return {Permission}
|
|
93
|
+
*/
|
|
94
|
+
const deleteProperty = (property, permission) => omit(`properties.${property}`, permission);
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Creates a new {@link Permission} object from raw attributes. Set default values for certain fields
|
|
98
|
+
* @param {Permission} attributes
|
|
99
|
+
* @return {Permission}
|
|
100
|
+
*/
|
|
101
|
+
const create = attributes => {
|
|
102
|
+
return pipe(pick(permissionFields), merge(getDefaultPermission()))(attributes);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Using the given condition provider, check and remove invalid condition from the permission's condition array.
|
|
107
|
+
* @param {object} provider - The condition provider used to do the checks
|
|
108
|
+
* @param {Permission} permission - The condition to sanitize
|
|
109
|
+
* @return {Permission}
|
|
110
|
+
*/
|
|
111
|
+
const sanitizeConditions = curry((provider, permission) => {
|
|
112
|
+
if (!isArray(permission.conditions)) {
|
|
113
|
+
return permission;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return permission.conditions
|
|
117
|
+
.filter(condition => !provider.has(condition))
|
|
118
|
+
.reduce((perm, condition) => removeCondition(condition, perm), permission);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Transform raw attributes into valid permissions using the create domain function.
|
|
123
|
+
* @param {object | object[]} payload - Can either be a single object of attributes or an array of those objects.
|
|
124
|
+
* @return {Permission | Permission[]}
|
|
125
|
+
*/
|
|
126
|
+
const toPermission = payload => (isArray(payload) ? map(create, payload) : create(payload));
|
|
127
|
+
|
|
128
|
+
module.exports = {
|
|
129
|
+
addCondition,
|
|
130
|
+
removeCondition,
|
|
131
|
+
create,
|
|
132
|
+
deleteProperty,
|
|
133
|
+
permissionFields,
|
|
134
|
+
getProperty,
|
|
135
|
+
sanitizedPermissionFields,
|
|
136
|
+
sanitizeConditions,
|
|
137
|
+
sanitizePermissionFields,
|
|
138
|
+
setProperty,
|
|
139
|
+
toPermission,
|
|
140
|
+
};
|
package/domain/role.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
contentTypes: { hasDraftAndPublish },
|
|
5
|
+
} = require('strapi-utils');
|
|
6
|
+
const {
|
|
7
|
+
AUTHOR_CODE,
|
|
8
|
+
PUBLISH_ACTION,
|
|
9
|
+
DELETE_ACTION,
|
|
10
|
+
UPDATE_ACTION,
|
|
11
|
+
CREATE_ACTION,
|
|
12
|
+
READ_ACTION,
|
|
13
|
+
} = require('../services/constants');
|
|
14
|
+
|
|
15
|
+
const BOUND_ACTIONS = [READ_ACTION, CREATE_ACTION, UPDATE_ACTION, DELETE_ACTION, PUBLISH_ACTION];
|
|
16
|
+
|
|
17
|
+
const BOUND_ACTIONS_FOR_FIELDS = [READ_ACTION, CREATE_ACTION, UPDATE_ACTION];
|
|
18
|
+
|
|
19
|
+
const getBoundActionsBySubject = (role, subject) => {
|
|
20
|
+
const model = strapi.getModel(subject);
|
|
21
|
+
|
|
22
|
+
if (role.code === AUTHOR_CODE || !hasDraftAndPublish(model)) {
|
|
23
|
+
return [READ_ACTION, UPDATE_ACTION, CREATE_ACTION, DELETE_ACTION];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return BOUND_ACTIONS;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports = { getBoundActionsBySubject, BOUND_ACTIONS, BOUND_ACTIONS_FOR_FIELDS };
|
package/domain/user.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { SUPER_ADMIN_CODE } = require('../services/constants');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Create a new user model by merging default and specified attributes
|
|
7
|
+
* @param attributes A partial user object
|
|
8
|
+
*/
|
|
9
|
+
function createUser(attributes) {
|
|
10
|
+
return {
|
|
11
|
+
roles: [],
|
|
12
|
+
isActive: false,
|
|
13
|
+
username: null,
|
|
14
|
+
...attributes,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const hasSuperAdminRole = user => {
|
|
19
|
+
return user.roles.filter(role => role.code === SUPER_ADMIN_CODE).length > 0;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
createUser,
|
|
24
|
+
hasSuperAdminRole,
|
|
25
|
+
};
|
package/ee/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
This Strapi Enterprise Edition (EE) supplemental license (this “EE Supplemental License”) governs the use of this software and documentation (collectively, the “EE Software”) by you and any entity you represent (collectively, “You”). If You have separately entered into the Strapi, Inc. Enterprise Agreement (the “Enterprise Agreement”), then this EE Supplemental License hereby incorporates by reference the Enterprise Agreement and modifies the Enterprise Agreement solely to the extent set forth herein. If You have separately entered into the Strapi, Inc. Subscription Agreement (the “Subscription Agreement”), then this EE Supplemental License hereby incorporates by reference the Agreement and modifies the Subscription Agreement solely to the extent set forth herein. If You have not entered into either the Enterprise Agreement or the Subscription Agreement, then You may use the EE Software solely as set forth in Section 2 below.
|
|
2
|
+
|
|
3
|
+
In the event of a direct conflict between the terms of this EE Supplemental License and the terms of the Enterprise Agreement or the Subscription Agreement, as applicable, the terms of this EE Supplemental License will control. Except to the extent modified by this EE Supplemental License, the Enterprise Agreement or the Subscription Agreement, as applicable, remain in full force and effect in accordance with its terms.
|
|
4
|
+
|
|
5
|
+
By using the EE Software, You hereby agree to the below terms and conditions.
|
|
6
|
+
|
|
7
|
+
1. Notwithstanding any terms to the contrary in the Enterprise Agreement or Subscription Agreement, You may copy, modify and publish patches to the EE Software in a production environment (such copies, “Production Copies,” such modifications, “Production Modifications” and such patches, “Production Patches”) if and only if (a) You have agreed to, and are in full compliance with, the Enterprise Agreement or Subscription Agreement, as applicable, and (b) You have a valid license to the EE Software for the correct number of projects. You agree that Strapi and/or its licensors (as applicable) will own all right, title and interest in and to all such Production Copies, Production Modifications and Production Patches. You may display and/or distribute such Production Copies, Production Modifications and Production Patches if and only if (i) You have a valid license to the EE Software for the correct number of projects and (ii) You are in compliance with the Enterprise Agreement or Subscription Agreement, as applicable. You hereby assign to Strapi all right, title and interest in and to all Production Copies, Production Modifications and Production Patches, including all intellectual property rights embodied in or related to the foregoing.
|
|
8
|
+
|
|
9
|
+
2. Notwithstanding the foregoing, You may copy and modify the EE Software solely for development and testing purposes (such copies, “Development Copies” and such modifications, “Development Modifications”) with or without a license to the EE Software if your use is in compliance with this Section 2. You agree that Strapi and/or its licensors (as applicable) will own all right, title and interest in and to all Development Copies and Development Modifications and You hereby assign to Strapi all right, title and interest in and to all Development Copies and Development Modifications, including all intellectual property rights embodied in or related to the foregoing. If You do not have a license to the EE Software, then You further agree as follows:
|
|
10
|
+
|
|
11
|
+
Other than as expressly set forth in this Section 2, You may not (a) copy or modify the EE Software, (b) create derivative works of the EE Software, (c) remove or modify any notice of any patent, copyright, trademark, or other proprietary rights that appear on or in the EE Software, (d) reverse engineer, decompile, translate, disassemble, or discover the source code of all or any portion of the EE Software, (e) publicly display all or any part of the EE Software, (f) distribute, disclose, market, lease, publish, merge, resell, assign, loan, sublicense, rent, or transfer the EE Software to any third party, (g) use the EE Software for any dial-up, remote access, interactive, or other on-line or hosted service, or to provide a service bureau, time share, or other services to third parties, (h) merge the EE Software into another product, (i) disclose the results of any EE Software performance benchmarks or test results to any third party without Strapi’s prior written consent, (j) use any trademarks, logos, service marks, trade names of Strapi, or any portion thereof, without Strapi’s prior written consent, (k) use the EE Software, or any portion thereof, in a manner that does not comply with applicable law, regulations, or governmental orders, or (l) use or store the EE Software on equipment not owned or controlled by Customer.
|
|
12
|
+
|
|
13
|
+
THE EE SOFTWARE IS PROVIDED ON AN “AS IS” BASIS WITHOUT ANY REPRESENTATIONS, WARRANTIES, COVENANTS, OR CONDITIONS OF ANY KIND (EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE), INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. FURTHER, STRAPI DOES NOT REPRESENT OR WARRANT THAT (A) THE ACCESS TO OR USE OF THE EE SOFTWARE WILL BE SECURE, TIMELY, UNINTERRUPTED, ERROR-FREE, OR OPERATE IN COMBINATION WITH ANY OTHER HARDWARE, SOFTWARE, SYSTEM, OR DATA, (B) THE EE SOFTWARE WILL MEET YOUR REQUIREMENTS OR EXPECTATIONS, OR OTHERWISE PRODUCE ANY PARTICULAR RESULTS, (C) ERRORS OR DEFECTS WILL BE CORRECTED, PATCHES OR WORKAROUNDS WILL BE PROVIDED, OR STRAPI WILL DETECT ANY BUG IN THE EE SOFTWARE, (D) THE SOFTWARE IS FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS, OR (E) THIRD-PARTY DISRUPTIONS OR SECURITY BREACHES OF THE EE SOFTWARE WILL BE PREVENTED.
|
|
14
|
+
|
|
15
|
+
STRAPI WILL NOT BE LIABLE FOR ANY LOSS OF PROFITS OR ANY INDIRECT, SPECIAL, INCIDENTAL, RELIANCE, OR CONSEQUENTIAL DAMAGES OF ANY KIND, REGARDLESS OF THE FORM OF ACTION, WHETHER IN CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY, OR OTHERWISE, EVEN IF INFORMED OF THE POSSIBILITY OF SUCH DAMAGES IN ADVANCE.
|
|
16
|
+
|
|
17
|
+
STRAPI’S ENTIRE LIABILITY TO YOU FOR USE OF THE EE SOFTWARE WILL NOT EXCEED $100.
|
|
18
|
+
|
|
19
|
+
3. You are not granted any other rights beyond what is expressly stated herein and in the Enterprise Agreement or Subscription Agreement, as applicable.
|
|
20
|
+
|
|
21
|
+
4. This EE Supplemental License does not apply to Strapi software that is distributed as part of the Strapi Community Edition (CE) (the “CE Software”).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Flex, Text } from '@buffetjs/core';
|
|
5
|
+
|
|
6
|
+
export const ProviderButtonWrapper = styled(props => <Flex {...props} />)`
|
|
7
|
+
width: 11rem;
|
|
8
|
+
height: 4.5rem;
|
|
9
|
+
padding: 0.5rem;
|
|
10
|
+
border-radius: ${({ theme }) => theme.main.sizes.borderRadius};
|
|
11
|
+
border: 1px solid ${({ theme }) => theme.main.colors.border};
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
&:hover {
|
|
14
|
+
${Text} {
|
|
15
|
+
color: ${({ theme }) => theme.main.colors.mediumBlue};
|
|
16
|
+
}
|
|
17
|
+
svg > path {
|
|
18
|
+
fill: ${({ theme }) => theme.main.colors.mediumBlue};
|
|
19
|
+
}
|
|
20
|
+
border: 1px solid ${({ theme }) => theme.main.colors.darkBlue};
|
|
21
|
+
background-color: ${({ theme }) => theme.main.colors.lightestBlue};
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
export const ProviderLink = styled.a`
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
text-decoration: none;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Text } from '@buffetjs/core';
|
|
4
|
+
import { Tooltip } from '@buffetjs/styles';
|
|
5
|
+
import { ProviderButtonWrapper, ProviderLink } from './ProviderButtonStyles';
|
|
6
|
+
|
|
7
|
+
const ProviderButton = ({ provider }) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<ProviderLink
|
|
11
|
+
href={`${strapi.backendURL}/admin/connect/${provider.uid}`}
|
|
12
|
+
data-for={provider.uid}
|
|
13
|
+
data-tip={provider.displayName}
|
|
14
|
+
>
|
|
15
|
+
<ProviderButtonWrapper justifyContent="center" alignItems="center">
|
|
16
|
+
{provider.icon ? (
|
|
17
|
+
<img
|
|
18
|
+
src={provider.icon}
|
|
19
|
+
alt={provider.displayName}
|
|
20
|
+
style={{ maxWidth: '100%', maxHeight: 30 }}
|
|
21
|
+
/>
|
|
22
|
+
) : (
|
|
23
|
+
<Text color="black" ellipsis>
|
|
24
|
+
{provider.displayName}
|
|
25
|
+
</Text>
|
|
26
|
+
)}
|
|
27
|
+
</ProviderButtonWrapper>
|
|
28
|
+
</ProviderLink>
|
|
29
|
+
<Tooltip id={provider.uid} />
|
|
30
|
+
</>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
ProviderButton.propTypes = {
|
|
35
|
+
provider: PropTypes.exact({
|
|
36
|
+
displayName: PropTypes.string,
|
|
37
|
+
icon: PropTypes.string,
|
|
38
|
+
uid: PropTypes.string,
|
|
39
|
+
}).isRequired,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default ProviderButton;
|