@backstage-community/plugin-rbac 1.32.2

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.
Files changed (133) hide show
  1. package/CHANGELOG.md +761 -0
  2. package/README.md +106 -0
  3. package/app-config.yaml +19 -0
  4. package/dist/api/LicensedUsersClient.esm.js +45 -0
  5. package/dist/api/LicensedUsersClient.esm.js.map +1 -0
  6. package/dist/api/RBACBackendClient.esm.js +337 -0
  7. package/dist/api/RBACBackendClient.esm.js.map +1 -0
  8. package/dist/components/Administration.esm.js +23 -0
  9. package/dist/components/Administration.esm.js.map +1 -0
  10. package/dist/components/ConditionalAccess/AddNestedConditionButton.esm.js +23 -0
  11. package/dist/components/ConditionalAccess/AddNestedConditionButton.esm.js.map +1 -0
  12. package/dist/components/ConditionalAccess/ComplexConditionRow.esm.js +149 -0
  13. package/dist/components/ConditionalAccess/ComplexConditionRow.esm.js.map +1 -0
  14. package/dist/components/ConditionalAccess/ComplexConditionRowButtons.esm.js +62 -0
  15. package/dist/components/ConditionalAccess/ComplexConditionRowButtons.esm.js.map +1 -0
  16. package/dist/components/ConditionalAccess/ConditionRule.esm.js +34 -0
  17. package/dist/components/ConditionalAccess/ConditionRule.esm.js.map +1 -0
  18. package/dist/components/ConditionalAccess/ConditionalAccessSidebar.esm.js +93 -0
  19. package/dist/components/ConditionalAccess/ConditionalAccessSidebar.esm.js.map +1 -0
  20. package/dist/components/ConditionalAccess/ConditionsForm.esm.js +204 -0
  21. package/dist/components/ConditionalAccess/ConditionsForm.esm.js.map +1 -0
  22. package/dist/components/ConditionalAccess/ConditionsFormRow.esm.js +459 -0
  23. package/dist/components/ConditionalAccess/ConditionsFormRow.esm.js.map +1 -0
  24. package/dist/components/ConditionalAccess/ConditionsFormRowFields.esm.js +209 -0
  25. package/dist/components/ConditionalAccess/ConditionsFormRowFields.esm.js.map +1 -0
  26. package/dist/components/ConditionalAccess/CriteriaToggleButton.esm.js +33 -0
  27. package/dist/components/ConditionalAccess/CriteriaToggleButton.esm.js.map +1 -0
  28. package/dist/components/ConditionalAccess/CustomArrayField.esm.js +47 -0
  29. package/dist/components/ConditionalAccess/CustomArrayField.esm.js.map +1 -0
  30. package/dist/components/ConditionalAccess/RulesDropdownOption.esm.js +24 -0
  31. package/dist/components/ConditionalAccess/RulesDropdownOption.esm.js.map +1 -0
  32. package/dist/components/ConditionalAccess/const.esm.js +21 -0
  33. package/dist/components/ConditionalAccess/const.esm.js.map +1 -0
  34. package/dist/components/ConditionalAccess/types.esm.js +8 -0
  35. package/dist/components/ConditionalAccess/types.esm.js.map +1 -0
  36. package/dist/components/CreateRole/AddMembersForm.esm.js +94 -0
  37. package/dist/components/CreateRole/AddMembersForm.esm.js.map +1 -0
  38. package/dist/components/CreateRole/AddedMembersTable.esm.js +31 -0
  39. package/dist/components/CreateRole/AddedMembersTable.esm.js.map +1 -0
  40. package/dist/components/CreateRole/AddedMembersTableColumn.esm.js +77 -0
  41. package/dist/components/CreateRole/AddedMembersTableColumn.esm.js.map +1 -0
  42. package/dist/components/CreateRole/CreateRolePage.esm.js +53 -0
  43. package/dist/components/CreateRole/CreateRolePage.esm.js.map +1 -0
  44. package/dist/components/CreateRole/EditRolePage.esm.js +65 -0
  45. package/dist/components/CreateRole/EditRolePage.esm.js.map +1 -0
  46. package/dist/components/CreateRole/MembersDropdownOption.esm.js +40 -0
  47. package/dist/components/CreateRole/MembersDropdownOption.esm.js.map +1 -0
  48. package/dist/components/CreateRole/PermissionPoliciesForm.esm.js +144 -0
  49. package/dist/components/CreateRole/PermissionPoliciesForm.esm.js.map +1 -0
  50. package/dist/components/CreateRole/PermissionPoliciesFormRow.esm.js +179 -0
  51. package/dist/components/CreateRole/PermissionPoliciesFormRow.esm.js.map +1 -0
  52. package/dist/components/CreateRole/PoliciesCheckboxGroup.esm.js +76 -0
  53. package/dist/components/CreateRole/PoliciesCheckboxGroup.esm.js.map +1 -0
  54. package/dist/components/CreateRole/ReviewStep.esm.js +50 -0
  55. package/dist/components/CreateRole/ReviewStep.esm.js.map +1 -0
  56. package/dist/components/CreateRole/ReviewStepTable.esm.js +29 -0
  57. package/dist/components/CreateRole/ReviewStepTable.esm.js.map +1 -0
  58. package/dist/components/CreateRole/RoleDetailsForm.esm.js +57 -0
  59. package/dist/components/CreateRole/RoleDetailsForm.esm.js.map +1 -0
  60. package/dist/components/CreateRole/RoleForm.esm.js +271 -0
  61. package/dist/components/CreateRole/RoleForm.esm.js.map +1 -0
  62. package/dist/components/CreateRole/SelectedPermissionPoliciesColumn.esm.js +34 -0
  63. package/dist/components/CreateRole/SelectedPermissionPoliciesColumn.esm.js.map +1 -0
  64. package/dist/components/CreateRole/const.esm.js +14 -0
  65. package/dist/components/CreateRole/const.esm.js.map +1 -0
  66. package/dist/components/DownloadUserStatistics.esm.js +51 -0
  67. package/dist/components/DownloadUserStatistics.esm.js.map +1 -0
  68. package/dist/components/EditRole.esm.js +30 -0
  69. package/dist/components/EditRole.esm.js.map +1 -0
  70. package/dist/components/RbacPage.esm.js +18 -0
  71. package/dist/components/RbacPage.esm.js.map +1 -0
  72. package/dist/components/RoleOverview/AboutCard.esm.js +89 -0
  73. package/dist/components/RoleOverview/AboutCard.esm.js.map +1 -0
  74. package/dist/components/RoleOverview/MembersCard.esm.js +87 -0
  75. package/dist/components/RoleOverview/MembersCard.esm.js.map +1 -0
  76. package/dist/components/RoleOverview/MembersListColumns.esm.js +48 -0
  77. package/dist/components/RoleOverview/MembersListColumns.esm.js.map +1 -0
  78. package/dist/components/RoleOverview/PermissionsCard.esm.js +99 -0
  79. package/dist/components/RoleOverview/PermissionsCard.esm.js.map +1 -0
  80. package/dist/components/RoleOverview/PermissionsListColumns.esm.js +43 -0
  81. package/dist/components/RoleOverview/PermissionsListColumns.esm.js.map +1 -0
  82. package/dist/components/RoleOverview/RoleOverviewPage.esm.js +49 -0
  83. package/dist/components/RoleOverview/RoleOverviewPage.esm.js.map +1 -0
  84. package/dist/components/RolesList/DeleteRole.esm.js +32 -0
  85. package/dist/components/RolesList/DeleteRole.esm.js.map +1 -0
  86. package/dist/components/RolesList/DeleteRoleDialog.esm.js +142 -0
  87. package/dist/components/RolesList/DeleteRoleDialog.esm.js.map +1 -0
  88. package/dist/components/RolesList/RolesList.esm.js +102 -0
  89. package/dist/components/RolesList/RolesList.esm.js.map +1 -0
  90. package/dist/components/RolesList/RolesListColumns.esm.js +76 -0
  91. package/dist/components/RolesList/RolesListColumns.esm.js.map +1 -0
  92. package/dist/components/RolesList/RolesListToolbar.esm.js +48 -0
  93. package/dist/components/RolesList/RolesListToolbar.esm.js.map +1 -0
  94. package/dist/components/Router.esm.js +57 -0
  95. package/dist/components/Router.esm.js.map +1 -0
  96. package/dist/components/SnackbarAlert.esm.js +23 -0
  97. package/dist/components/SnackbarAlert.esm.js.map +1 -0
  98. package/dist/components/ToastContext.esm.js +19 -0
  99. package/dist/components/ToastContext.esm.js.map +1 -0
  100. package/dist/components/index.esm.js +5 -0
  101. package/dist/components/index.esm.js.map +1 -0
  102. package/dist/hooks/useCheckIfLicensePluginEnabled.esm.js +20 -0
  103. package/dist/hooks/useCheckIfLicensePluginEnabled.esm.js.map +1 -0
  104. package/dist/hooks/useConditionRules.esm.js +64 -0
  105. package/dist/hooks/useConditionRules.esm.js.map +1 -0
  106. package/dist/hooks/useLocationToast.esm.js +15 -0
  107. package/dist/hooks/useLocationToast.esm.js.map +1 -0
  108. package/dist/hooks/useMembers.esm.js +92 -0
  109. package/dist/hooks/useMembers.esm.js.map +1 -0
  110. package/dist/hooks/usePermissionPolicies.esm.js +80 -0
  111. package/dist/hooks/usePermissionPolicies.esm.js.map +1 -0
  112. package/dist/hooks/useRole.esm.js +23 -0
  113. package/dist/hooks/useRole.esm.js.map +1 -0
  114. package/dist/hooks/useRoles.esm.js +169 -0
  115. package/dist/hooks/useRoles.esm.js.map +1 -0
  116. package/dist/hooks/useSelectedMembers.esm.js +39 -0
  117. package/dist/hooks/useSelectedMembers.esm.js.map +1 -0
  118. package/dist/index.d.ts +17 -0
  119. package/dist/index.esm.js +4 -0
  120. package/dist/index.esm.js.map +1 -0
  121. package/dist/plugin.esm.js +49 -0
  122. package/dist/plugin.esm.js.map +1 -0
  123. package/dist/routes.esm.js +23 -0
  124. package/dist/routes.esm.js.map +1 -0
  125. package/dist/utils/conditional-access-utils.esm.js +268 -0
  126. package/dist/utils/conditional-access-utils.esm.js.map +1 -0
  127. package/dist/utils/create-role-utils.esm.js +231 -0
  128. package/dist/utils/create-role-utils.esm.js.map +1 -0
  129. package/dist/utils/rbac-utils.esm.js +256 -0
  130. package/dist/utils/rbac-utils.esm.js.map +1 -0
  131. package/dist/utils/role-form-utils.esm.js +66 -0
  132. package/dist/utils/role-form-utils.esm.js.map +1 -0
  133. package/package.json +120 -0
@@ -0,0 +1,39 @@
1
+ import { useAsync } from 'react-use';
2
+ import { stringifyEntityRef } from '@backstage/catalog-model';
3
+ import { useApi } from '@backstage/core-plugin-api';
4
+ import { rbacApiRef } from '../api/RBACBackendClient.esm.js';
5
+ import { getSelectedMember } from '../utils/rbac-utils.esm.js';
6
+ import { useRole } from './useRole.esm.js';
7
+
8
+ const useSelectedMembers = (roleName) => {
9
+ const rbacApi = useApi(rbacApiRef);
10
+ const { role, loading: roleLoading, roleError } = useRole(roleName);
11
+ const {
12
+ loading: membersLoading,
13
+ value: members,
14
+ error: membersError
15
+ } = useAsync(async () => {
16
+ return await rbacApi.getMembers();
17
+ });
18
+ const canReadUsersAndGroups = !membersLoading && !membersError && Array.isArray(members) && members.length > 0;
19
+ const data = role ? role.memberReferences.reduce((acc, ref) => {
20
+ const memberResource = Array.isArray(members) && members.find((member) => stringifyEntityRef(member) === ref) || void 0;
21
+ acc.push(getSelectedMember(memberResource, ref));
22
+ return acc;
23
+ }, []) : [];
24
+ return {
25
+ selectedMembers: data,
26
+ members: Array.isArray(members) ? members : [],
27
+ role,
28
+ membersError: membersError || {
29
+ name: members?.status,
30
+ message: members?.statusText
31
+ },
32
+ roleError,
33
+ loading: roleLoading || membersLoading,
34
+ canReadUsersAndGroups
35
+ };
36
+ };
37
+
38
+ export { useSelectedMembers };
39
+ //# sourceMappingURL=useSelectedMembers.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelectedMembers.esm.js","sources":["../../src/hooks/useSelectedMembers.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useAsync } from 'react-use';\n\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { Role } from '@backstage-community/plugin-rbac-common';\n\nimport { rbacApiRef } from '../api/RBACBackendClient';\nimport { SelectedMember } from '../components/CreateRole/types';\nimport { MemberEntity } from '../types';\nimport { getSelectedMember } from '../utils/rbac-utils';\nimport { useRole } from './useRole';\n\nexport const useSelectedMembers = (\n roleName: string,\n): {\n members: MemberEntity[];\n selectedMembers: SelectedMember[];\n role: Role | undefined;\n membersError: Error;\n roleError: Error;\n loading: boolean;\n canReadUsersAndGroups: boolean;\n} => {\n const rbacApi = useApi(rbacApiRef);\n const { role, loading: roleLoading, roleError } = useRole(roleName);\n\n const {\n loading: membersLoading,\n value: members,\n error: membersError,\n } = useAsync(async () => {\n return await rbacApi.getMembers();\n });\n\n const canReadUsersAndGroups =\n !membersLoading &&\n !membersError &&\n Array.isArray(members) &&\n members.length > 0;\n\n const data: SelectedMember[] = role\n ? (role as Role).memberReferences.reduce((acc: SelectedMember[], ref) => {\n const memberResource =\n (Array.isArray(members) &&\n members.find(member => stringifyEntityRef(member) === ref)) ||\n undefined;\n acc.push(getSelectedMember(memberResource, ref));\n\n return acc;\n }, [])\n : [];\n\n return {\n selectedMembers: data,\n members: Array.isArray(members) ? members : ([] as MemberEntity[]),\n role,\n membersError: (membersError as Error) || {\n name: (members as Response)?.status,\n message: (members as Response)?.statusText,\n },\n roleError: roleError,\n loading: roleLoading || membersLoading,\n canReadUsersAndGroups,\n };\n};\n"],"names":[],"mappings":";;;;;;;AA4Ba,MAAA,kBAAA,GAAqB,CAChC,QASG,KAAA;AACH,EAAM,MAAA,OAAA,GAAU,OAAO,UAAU,CAAA,CAAA;AACjC,EAAA,MAAM,EAAE,IAAM,EAAA,OAAA,EAAS,aAAa,SAAU,EAAA,GAAI,QAAQ,QAAQ,CAAA,CAAA;AAElE,EAAM,MAAA;AAAA,IACJ,OAAS,EAAA,cAAA;AAAA,IACT,KAAO,EAAA,OAAA;AAAA,IACP,KAAO,EAAA,YAAA;AAAA,GACT,GAAI,SAAS,YAAY;AACvB,IAAO,OAAA,MAAM,QAAQ,UAAW,EAAA,CAAA;AAAA,GACjC,CAAA,CAAA;AAED,EAAM,MAAA,qBAAA,GACJ,CAAC,cAAA,IACD,CAAC,YAAA,IACD,MAAM,OAAQ,CAAA,OAAO,CACrB,IAAA,OAAA,CAAQ,MAAS,GAAA,CAAA,CAAA;AAEnB,EAAA,MAAM,OAAyB,IAC1B,GAAA,IAAA,CAAc,iBAAiB,MAAO,CAAA,CAAC,KAAuB,GAAQ,KAAA;AACrE,IAAA,MAAM,cACH,GAAA,KAAA,CAAM,OAAQ,CAAA,OAAO,CACpB,IAAA,OAAA,CAAQ,IAAK,CAAA,CAAA,MAAA,KAAU,kBAAmB,CAAA,MAAM,CAAM,KAAA,GAAG,CAC3D,IAAA,KAAA,CAAA,CAAA;AACF,IAAA,GAAA,CAAI,IAAK,CAAA,iBAAA,CAAkB,cAAgB,EAAA,GAAG,CAAC,CAAA,CAAA;AAE/C,IAAO,OAAA,GAAA,CAAA;AAAA,GACN,EAAA,EAAE,CAAA,GACL,EAAC,CAAA;AAEL,EAAO,OAAA;AAAA,IACL,eAAiB,EAAA,IAAA;AAAA,IACjB,SAAS,KAAM,CAAA,OAAA,CAAQ,OAAO,CAAA,GAAI,UAAW,EAAC;AAAA,IAC9C,IAAA;AAAA,IACA,cAAe,YAA0B,IAAA;AAAA,MACvC,MAAO,OAAsB,EAAA,MAAA;AAAA,MAC7B,SAAU,OAAsB,EAAA,UAAA;AAAA,KAClC;AAAA,IACA,SAAA;AAAA,IACA,SAAS,WAAe,IAAA,cAAA;AAAA,IACxB,qBAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import * as react from 'react';
3
+ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
4
+ export { default as AdminPanelSettingsOutlinedIcon } from '@mui/icons-material/AdminPanelSettingsOutlined';
5
+ export { default as RbacIcon } from '@mui/icons-material/VpnKeyOutlined';
6
+
7
+ declare const rbacPlugin: _backstage_core_plugin_api.BackstagePlugin<{
8
+ root: _backstage_core_plugin_api.RouteRef<undefined>;
9
+ role: _backstage_core_plugin_api.SubRouteRef<_backstage_core_plugin_api.PathParams<"/roles/:roleKind/:roleNamespace/:roleName">>;
10
+ createRole: _backstage_core_plugin_api.SubRouteRef<undefined>;
11
+ }, {}, {}>;
12
+ declare const RbacPage: ({ useHeader }: {
13
+ useHeader?: boolean | undefined;
14
+ }) => react.JSX.Element;
15
+ declare const Administration: () => react.JSX.Element | null;
16
+
17
+ export { Administration, RbacPage, rbacPlugin };
@@ -0,0 +1,4 @@
1
+ export { Administration, RbacPage, rbacPlugin } from './plugin.esm.js';
2
+ export { default as AdminPanelSettingsOutlinedIcon } from '@mui/icons-material/AdminPanelSettingsOutlined';
3
+ export { default as RbacIcon } from '@mui/icons-material/VpnKeyOutlined';
4
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,49 @@
1
+ import { createPlugin, createApiFactory, configApiRef, identityApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
2
+ import { licensedUsersApiRef, LicensedUsersAPIClient } from './api/LicensedUsersClient.esm.js';
3
+ import { rbacApiRef, RBACBackendClient } from './api/RBACBackendClient.esm.js';
4
+ import { rootRouteRef, roleRouteRef, createRoleRouteRef } from './routes.esm.js';
5
+
6
+ const rbacPlugin = createPlugin({
7
+ id: "rbac",
8
+ routes: {
9
+ root: rootRouteRef,
10
+ role: roleRouteRef,
11
+ createRole: createRoleRouteRef
12
+ },
13
+ apis: [
14
+ createApiFactory({
15
+ api: rbacApiRef,
16
+ deps: {
17
+ configApi: configApiRef,
18
+ identityApi: identityApiRef
19
+ },
20
+ factory: ({ configApi, identityApi }) => new RBACBackendClient({ configApi, identityApi })
21
+ }),
22
+ createApiFactory({
23
+ api: licensedUsersApiRef,
24
+ deps: {
25
+ configApi: configApiRef,
26
+ identityApi: identityApiRef
27
+ },
28
+ factory: ({ configApi, identityApi }) => new LicensedUsersAPIClient({ configApi, identityApi })
29
+ })
30
+ ]
31
+ });
32
+ const RbacPage = rbacPlugin.provide(
33
+ createRoutableExtension({
34
+ name: "RbacPage",
35
+ component: () => import('./components/index.esm.js').then((m) => m.Router),
36
+ mountPoint: rootRouteRef
37
+ })
38
+ );
39
+ const Administration = rbacPlugin.provide(
40
+ createComponentExtension({
41
+ name: "Administration",
42
+ component: {
43
+ lazy: () => import('./components/index.esm.js').then((m) => m.Administration)
44
+ }
45
+ })
46
+ );
47
+
48
+ export { Administration, RbacPage, rbacPlugin };
49
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n configApiRef,\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n identityApiRef,\n} from '@backstage/core-plugin-api';\n\nimport {\n LicensedUsersAPIClient,\n licensedUsersApiRef,\n} from './api/LicensedUsersClient';\nimport { rbacApiRef, RBACBackendClient } from './api/RBACBackendClient';\nimport { createRoleRouteRef, roleRouteRef, rootRouteRef } from './routes';\n\nexport const rbacPlugin = createPlugin({\n id: 'rbac',\n routes: {\n root: rootRouteRef,\n role: roleRouteRef,\n createRole: createRoleRouteRef,\n },\n apis: [\n createApiFactory({\n api: rbacApiRef,\n deps: {\n configApi: configApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ configApi, identityApi }) =>\n new RBACBackendClient({ configApi, identityApi }),\n }),\n createApiFactory({\n api: licensedUsersApiRef,\n deps: {\n configApi: configApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ configApi, identityApi }) =>\n new LicensedUsersAPIClient({ configApi, identityApi }),\n }),\n ],\n});\n\nexport const RbacPage = rbacPlugin.provide(\n createRoutableExtension({\n name: 'RbacPage',\n component: () => import('./components').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n);\n\nexport const Administration = rbacPlugin.provide(\n createComponentExtension({\n name: 'Administration',\n component: {\n lazy: () => import('./components').then(m => m.Administration),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;AA+BO,MAAM,aAAa,YAAa,CAAA;AAAA,EACrC,EAAI,EAAA,MAAA;AAAA,EACJ,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,IACN,UAAY,EAAA,kBAAA;AAAA,GACd;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,UAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,SAAW,EAAA,YAAA;AAAA,QACX,WAAa,EAAA,cAAA;AAAA,OACf;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,SAAW,EAAA,WAAA,EACrB,KAAA,IAAI,iBAAkB,CAAA,EAAE,SAAW,EAAA,WAAA,EAAa,CAAA;AAAA,KACnD,CAAA;AAAA,IACD,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,mBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,SAAW,EAAA,YAAA;AAAA,QACX,WAAa,EAAA,cAAA;AAAA,OACf;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,SAAW,EAAA,WAAA,EACrB,KAAA,IAAI,sBAAuB,CAAA,EAAE,SAAW,EAAA,WAAA,EAAa,CAAA;AAAA,KACxD,CAAA;AAAA,GACH;AACF,CAAC,EAAA;AAEM,MAAM,WAAW,UAAW,CAAA,OAAA;AAAA,EACjC,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,UAAA;AAAA,IACN,SAAA,EAAW,MAAM,OAAO,2BAAc,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,MAAM,CAAA;AAAA,IAC1D,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH,EAAA;AAEO,MAAM,iBAAiB,UAAW,CAAA,OAAA;AAAA,EACvC,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,gBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,2BAAc,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,cAAc,CAAA;AAAA,KAC/D;AAAA,GACD,CAAA;AACH;;;;"}
@@ -0,0 +1,23 @@
1
+ import { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';
2
+
3
+ const rootRouteRef = createRouteRef({
4
+ id: "rbac"
5
+ });
6
+ const roleRouteRef = createSubRouteRef({
7
+ id: "rbac-role-overview",
8
+ parent: rootRouteRef,
9
+ path: "/roles/:roleKind/:roleNamespace/:roleName"
10
+ });
11
+ const createRoleRouteRef = createSubRouteRef({
12
+ id: "rbac-create-role",
13
+ parent: rootRouteRef,
14
+ path: "/role/new"
15
+ });
16
+ const editRoleRouteRef = createSubRouteRef({
17
+ id: "rbac-edit-role",
18
+ parent: rootRouteRef,
19
+ path: "/role/:roleKind/:roleNamespace/:roleName"
20
+ });
21
+
22
+ export { createRoleRouteRef, editRoleRouteRef, roleRouteRef, rootRouteRef };
23
+ //# sourceMappingURL=routes.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'rbac',\n});\n\nexport const roleRouteRef = createSubRouteRef({\n id: 'rbac-role-overview',\n parent: rootRouteRef,\n path: '/roles/:roleKind/:roleNamespace/:roleName',\n});\n\nexport const createRoleRouteRef = createSubRouteRef({\n id: 'rbac-create-role',\n parent: rootRouteRef,\n path: '/role/new',\n});\n\nexport const editRoleRouteRef = createSubRouteRef({\n id: 'rbac-edit-role',\n parent: rootRouteRef,\n path: '/role/:roleKind/:roleNamespace/:roleName',\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA,MAAA;AACN,CAAC,EAAA;AAEM,MAAM,eAAe,iBAAkB,CAAA;AAAA,EAC5C,EAAI,EAAA,oBAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA,2CAAA;AACR,CAAC,EAAA;AAEM,MAAM,qBAAqB,iBAAkB,CAAA;AAAA,EAClD,EAAI,EAAA,kBAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA,WAAA;AACR,CAAC,EAAA;AAEM,MAAM,mBAAmB,iBAAkB,CAAA;AAAA,EAChD,EAAI,EAAA,gBAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA,0CAAA;AACR,CAAC;;;;"}
@@ -0,0 +1,268 @@
1
+ import { makeStyles } from '@material-ui/core';
2
+ import { conditionButtons, criterias } from '../components/ConditionalAccess/const.esm.js';
3
+ import { NotConditionType } from '../components/ConditionalAccess/types.esm.js';
4
+
5
+ const ruleOptionDisabled = (ruleOption, conditions) => {
6
+ return !!(conditions || []).find((con) => con.rule === ruleOption);
7
+ };
8
+ const nestedConditionButtons = conditionButtons.filter(
9
+ (button) => button.val !== "condition"
10
+ );
11
+ const extractNestedConditions = (conditions, criteriaTypes, nestedConditions) => {
12
+ conditions.forEach((c) => {
13
+ criteriaTypes.forEach((ct) => {
14
+ if (Object.keys(c).includes(ct)) {
15
+ nestedConditions.push(c);
16
+ }
17
+ });
18
+ });
19
+ };
20
+ const getDefaultRule = (selPluginResourceType) => ({
21
+ rule: "",
22
+ resourceType: selPluginResourceType,
23
+ params: {}
24
+ });
25
+ const makeConditionsFormRowStyles = makeStyles((theme) => ({
26
+ conditionRow: {
27
+ padding: "20px",
28
+ border: `1px solid ${theme.palette.border}`,
29
+ borderRadius: "4px",
30
+ backgroundColor: theme.palette.background.default,
31
+ "& input": {
32
+ color: `${theme.palette.textContrast}!important`,
33
+ "&:-internal-autofill-selected, &:-webkit-autofill, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active": {
34
+ WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.background.paper} inset`,
35
+ WebkitTextFillColor: `${theme.palette.textContrast}!important`,
36
+ caretColor: `${theme.palette.textContrast}!important`
37
+ }
38
+ },
39
+ "& button": {
40
+ textTransform: "none"
41
+ }
42
+ },
43
+ nestedConditionRow: {
44
+ padding: "20px",
45
+ marginLeft: theme.spacing(3),
46
+ border: `1px solid ${theme.palette.border}`,
47
+ borderRadius: "4px",
48
+ backgroundColor: theme.palette.background.default,
49
+ "& input": {
50
+ backgroundColor: `${theme.palette.background.paper}!important`
51
+ }
52
+ },
53
+ criteriaButtonGroup: {
54
+ backgroundColor: theme.palette.background.paper,
55
+ width: "80%"
56
+ },
57
+ criteriaButton: {
58
+ width: "100%",
59
+ padding: `${theme.spacing(1)}px !important`
60
+ },
61
+ nestedConditioncriteriaButtonGroup: {
62
+ backgroundColor: theme.palette.background.paper,
63
+ width: "60%",
64
+ height: "100%"
65
+ },
66
+ addRuleButton: {
67
+ display: "flex !important",
68
+ color: theme.palette.primary.light,
69
+ textTransform: "none"
70
+ },
71
+ addNestedConditionButton: {
72
+ display: "flex !important",
73
+ color: theme.palette.primary.light,
74
+ textTransform: "none"
75
+ },
76
+ removeRuleButton: {
77
+ color: theme.palette.grey[500],
78
+ flexGrow: 0,
79
+ alignSelf: "baseline",
80
+ marginTop: theme.spacing(3.3)
81
+ },
82
+ removeNestedRuleButton: {
83
+ color: theme.palette.grey[500],
84
+ flexGrow: 0,
85
+ alignSelf: "baseline"
86
+ },
87
+ radioGroup: {
88
+ margin: theme.spacing(1)
89
+ },
90
+ radioLabel: {
91
+ marginTop: theme.spacing(1)
92
+ }
93
+ }));
94
+ const makeConditionsFormRowFieldsStyles = makeStyles(
95
+ (theme) => ({
96
+ bgPaper: {
97
+ backgroundColor: theme.palette.background.paper
98
+ },
99
+ params: {
100
+ '& div[class*="MuiInputBase-root"]': {
101
+ backgroundColor: theme.palette.background.paper
102
+ },
103
+ "& span": {
104
+ color: theme.palette.textSubtle
105
+ },
106
+ "& input": {
107
+ color: theme.palette.textContrast
108
+ },
109
+ "& fieldset.MuiOutlinedInput-notchedOutline": {
110
+ borderColor: theme.palette.grey[500]
111
+ },
112
+ "& div.MuiOutlinedInput-root": {
113
+ "&.Mui-focused .MuiOutlinedInput-notchedOutline": {
114
+ borderColor: theme.palette.primary.light
115
+ },
116
+ "&.Mui-error .MuiOutlinedInput-notchedOutline": {
117
+ borderColor: theme.palette.status.error,
118
+ "&:hover": {
119
+ borderColor: theme.palette.status.error
120
+ }
121
+ }
122
+ },
123
+ "& label.MuiFormLabel-root.Mui-focused": {
124
+ color: theme.palette.primary.light
125
+ },
126
+ "& label.MuiFormLabel-root.Mui-error": {
127
+ color: theme.palette.status.error
128
+ },
129
+ "& div.MuiOutlinedInput-root:hover fieldset": {
130
+ borderColor: theme.palette.type === "dark" ? theme.palette.textContrast : "unset"
131
+ },
132
+ "& label": {
133
+ color: theme.palette.textSubtle
134
+ }
135
+ },
136
+ inputFieldContainer: {
137
+ display: "flex",
138
+ flexFlow: "row",
139
+ gap: "10px",
140
+ flexGrow: 1,
141
+ margin: ({ isNotSimpleCondition }) => isNotSimpleCondition ? "-1.5rem 0 0 1.85rem" : "0"
142
+ }
143
+ })
144
+ );
145
+ const getSimpleRulesCount = (conditionRow, criteria) => {
146
+ if (criteria === criterias.not) {
147
+ return conditionRow[criteria].resourceType ? 1 : 0;
148
+ }
149
+ if (criteria === criterias.condition) {
150
+ return 1;
151
+ }
152
+ return conditionRow[criteria].filter(
153
+ (e) => "rule" in e
154
+ ).length;
155
+ };
156
+ const initializeErrors = (criteria, conditions) => {
157
+ const errors = {};
158
+ const initialize = (cond) => {
159
+ if ("rule" in cond) {
160
+ return "";
161
+ }
162
+ const nestedErrors = {};
163
+ if (cond.allOf) {
164
+ nestedErrors.allOf = cond.allOf.map(initialize) || [];
165
+ }
166
+ if (cond.anyOf) {
167
+ nestedErrors.anyOf = cond.anyOf.map(initialize) || [];
168
+ }
169
+ if (cond.not) {
170
+ nestedErrors.not = initialize(cond.not) || "";
171
+ }
172
+ return nestedErrors;
173
+ };
174
+ if (criteria === criterias.condition) {
175
+ errors.condition = "";
176
+ } else if (criteria === criterias.not) {
177
+ const notCondition = conditions.not;
178
+ let notConditionType;
179
+ if (notCondition === void 0) {
180
+ notConditionType = NotConditionType.SimpleCondition;
181
+ } else if ("rule" in notCondition) {
182
+ notConditionType = NotConditionType.SimpleCondition;
183
+ } else {
184
+ notConditionType = NotConditionType.NestedCondition;
185
+ }
186
+ if (notConditionType === NotConditionType.SimpleCondition) {
187
+ errors.not = "";
188
+ } else {
189
+ errors.not = initialize(conditions.not);
190
+ }
191
+ } else if (criteria === criterias.allOf || criteria === criterias.anyOf) {
192
+ errors[criteria] = Array.isArray(conditions[criteria]) ? conditions[criteria].map(initialize) : [""];
193
+ }
194
+ return errors;
195
+ };
196
+ const resetErrors = (criteria, notConditionType = NotConditionType.SimpleCondition) => {
197
+ const errors = {};
198
+ if (criteria === criterias.condition || criteria === criterias.not && notConditionType === NotConditionType.SimpleCondition) {
199
+ errors[criteria] = "";
200
+ }
201
+ if (criteria === criterias.allOf || criteria === criterias.anyOf) {
202
+ errors[criteria] = [""];
203
+ }
204
+ if (criteria === criterias.not && notConditionType === NotConditionType.NestedCondition) {
205
+ errors[criteria] = { [criterias.allOf]: [""] };
206
+ }
207
+ return errors;
208
+ };
209
+ const setErrorMessage = (errors) => errors[0] ? `Error in the ${errors[0].property} field.` : "";
210
+ const getSimpleRuleErrors = (errors) => errors.filter(
211
+ (err) => typeof err === "string"
212
+ ) || [];
213
+ const getNestedRuleErrors = (errors) => errors.filter(
214
+ (err) => typeof err !== "string"
215
+ ) || [];
216
+ const isNestedConditionRule = (r) => {
217
+ return criterias.allOf in r || criterias.anyOf in r || criterias.not in r;
218
+ };
219
+ const getNestedConditionSimpleRulesCount = (nc, c) => {
220
+ if (c === criterias.not) {
221
+ return nc[c].resourceType ? 1 : 0;
222
+ }
223
+ return nc[c].filter(
224
+ (r) => "resourceType" in r
225
+ ).length;
226
+ };
227
+ const getRowStyle = (c, isNestedCondition) => isNestedCondition ? {
228
+ display: c.rule !== void 0 ? "flex" : "none"
229
+ } : { display: "flex", gap: "10px" };
230
+ const getRowKey = (isNestedCondition, ruleIndex) => isNestedCondition ? `nestedCondition-rule-${ruleIndex}` : `condition-rule-${ruleIndex}`;
231
+ const hasAllOfOrAnyOfErrors = (errors, criteria) => {
232
+ if (!errors) return false;
233
+ const criteriaErrors = errors[criteria];
234
+ const simpleRuleErrors = criteriaErrors.filter(
235
+ (e) => typeof e === "string"
236
+ );
237
+ const nestedRuleErrors = criteriaErrors.filter(
238
+ (e) => typeof e !== "string"
239
+ );
240
+ if (simpleRuleErrors.some((e) => e.length > 0)) {
241
+ return true;
242
+ }
243
+ return nestedRuleErrors.some((err) => {
244
+ const nestedCriteria = Object.keys(err)[0];
245
+ const nestedErrors = err[nestedCriteria];
246
+ if (Array.isArray(nestedErrors)) {
247
+ return nestedErrors.some((e) => e.length > 0);
248
+ }
249
+ return nestedErrors?.length > 0;
250
+ });
251
+ };
252
+ const hasSimpleConditionOrNotErrors = (errors, criteria) => {
253
+ if (!errors) return false;
254
+ return (errors[criteria] || "").length > 0;
255
+ };
256
+ const hasNestedNotErrors = (errors, conditions, criteria) => {
257
+ if (!errors) return false;
258
+ const nestedCriteria = Object.keys(conditions[criteria])[0];
259
+ const nestedErrors = errors[criterias.not][nestedCriteria];
260
+ if (Array.isArray(nestedErrors)) {
261
+ return nestedErrors.some((e) => e.length > 0);
262
+ }
263
+ return nestedErrors?.length > 0;
264
+ };
265
+ const isSimpleRule = (con) => "rule" in con;
266
+
267
+ export { extractNestedConditions, getDefaultRule, getNestedConditionSimpleRulesCount, getNestedRuleErrors, getRowKey, getRowStyle, getSimpleRuleErrors, getSimpleRulesCount, hasAllOfOrAnyOfErrors, hasNestedNotErrors, hasSimpleConditionOrNotErrors, initializeErrors, isNestedConditionRule, isSimpleRule, makeConditionsFormRowFieldsStyles, makeConditionsFormRowStyles, nestedConditionButtons, resetErrors, ruleOptionDisabled, setErrorMessage };
268
+ //# sourceMappingURL=conditional-access-utils.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-access-utils.esm.js","sources":["../../src/utils/conditional-access-utils.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PermissionCondition } from '@backstage/plugin-permission-common';\n\nimport { makeStyles, Theme } from '@material-ui/core';\nimport { RJSFValidationError } from '@rjsf/utils';\n\nimport {\n conditionButtons,\n criterias,\n} from '../components/ConditionalAccess/const';\nimport {\n AccessConditionsErrors,\n ComplexErrors,\n Condition,\n ConditionsData,\n NestedCriteriaErrors,\n NotConditionType,\n} from '../components/ConditionalAccess/types';\n\nexport const ruleOptionDisabled = (\n ruleOption: string,\n conditions?: PermissionCondition[],\n) => {\n return !!(conditions || []).find(con => con.rule === ruleOption);\n};\n\nexport const nestedConditionButtons = conditionButtons.filter(\n button => button.val !== 'condition',\n);\n\nexport const extractNestedConditions = (\n conditions: Condition[],\n criteriaTypes: string[],\n nestedConditions: Condition[],\n) => {\n conditions.forEach(c => {\n criteriaTypes.forEach(ct => {\n if (Object.keys(c).includes(ct)) {\n nestedConditions.push(c);\n }\n });\n });\n};\n\nexport const getDefaultRule = (selPluginResourceType: string) => ({\n rule: '',\n resourceType: selPluginResourceType,\n params: {},\n});\n\nexport const makeConditionsFormRowStyles = makeStyles(theme => ({\n conditionRow: {\n padding: '20px',\n border: `1px solid ${theme.palette.border}`,\n borderRadius: '4px',\n backgroundColor: theme.palette.background.default,\n '& input': {\n color: `${theme.palette.textContrast}!important`,\n '&:-internal-autofill-selected, &:-webkit-autofill, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active':\n {\n WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.background.paper} inset`,\n WebkitTextFillColor: `${theme.palette.textContrast}!important`,\n caretColor: `${theme.palette.textContrast}!important`,\n },\n },\n '& button': {\n textTransform: 'none',\n },\n },\n nestedConditionRow: {\n padding: '20px',\n marginLeft: theme.spacing(3),\n border: `1px solid ${theme.palette.border}`,\n borderRadius: '4px',\n backgroundColor: theme.palette.background.default,\n '& input': {\n backgroundColor: `${theme.palette.background.paper}!important`,\n },\n },\n criteriaButtonGroup: {\n backgroundColor: theme.palette.background.paper,\n width: '80%',\n },\n criteriaButton: {\n width: '100%',\n padding: `${theme.spacing(1)}px !important`,\n },\n nestedConditioncriteriaButtonGroup: {\n backgroundColor: theme.palette.background.paper,\n width: '60%',\n height: '100%',\n },\n addRuleButton: {\n display: 'flex !important',\n color: theme.palette.primary.light,\n textTransform: 'none',\n },\n addNestedConditionButton: {\n display: 'flex !important',\n color: theme.palette.primary.light,\n textTransform: 'none',\n },\n removeRuleButton: {\n color: theme.palette.grey[500],\n flexGrow: 0,\n alignSelf: 'baseline',\n marginTop: theme.spacing(3.3),\n },\n removeNestedRuleButton: {\n color: theme.palette.grey[500],\n flexGrow: 0,\n alignSelf: 'baseline',\n },\n radioGroup: {\n margin: theme.spacing(1),\n },\n radioLabel: {\n marginTop: theme.spacing(1),\n },\n}));\n\ninterface StyleProps {\n isNotSimpleCondition: boolean;\n}\nexport const makeConditionsFormRowFieldsStyles = makeStyles<Theme, StyleProps>(\n theme => ({\n bgPaper: {\n backgroundColor: theme.palette.background.paper,\n },\n params: {\n '& div[class*=\"MuiInputBase-root\"]': {\n backgroundColor: theme.palette.background.paper,\n },\n '& span': {\n color: theme.palette.textSubtle,\n },\n '& input': {\n color: theme.palette.textContrast,\n },\n '& fieldset.MuiOutlinedInput-notchedOutline': {\n borderColor: theme.palette.grey[500],\n },\n '& div.MuiOutlinedInput-root': {\n '&.Mui-focused .MuiOutlinedInput-notchedOutline': {\n borderColor: theme.palette.primary.light,\n },\n '&.Mui-error .MuiOutlinedInput-notchedOutline': {\n borderColor: theme.palette.status.error,\n '&:hover': {\n borderColor: theme.palette.status.error,\n },\n },\n },\n '& label.MuiFormLabel-root.Mui-focused': {\n color: theme.palette.primary.light,\n },\n '& label.MuiFormLabel-root.Mui-error': {\n color: theme.palette.status.error,\n },\n '& div.MuiOutlinedInput-root:hover fieldset': {\n borderColor:\n theme.palette.type === 'dark' ? theme.palette.textContrast : 'unset',\n },\n '& label': {\n color: theme.palette.textSubtle,\n },\n },\n inputFieldContainer: {\n display: 'flex',\n flexFlow: 'row',\n gap: '10px',\n flexGrow: 1,\n margin: ({ isNotSimpleCondition }) =>\n isNotSimpleCondition ? '-1.5rem 0 0 1.85rem' : '0',\n },\n }),\n);\n\nexport const getSimpleRulesCount = (\n conditionRow: ConditionsData,\n criteria: string,\n): number => {\n if (criteria === criterias.not) {\n return (conditionRow[criteria as keyof Condition] as PermissionCondition)\n .resourceType\n ? 1\n : 0;\n }\n if (criteria === criterias.condition) {\n return 1;\n }\n return (conditionRow[criteria as keyof Condition] as Condition[]).filter(\n (e: Condition) => 'rule' in e,\n ).length;\n};\n\nexport const initializeErrors = (\n criteria: keyof ConditionsData,\n conditions: ConditionsData,\n): AccessConditionsErrors => {\n const errors: AccessConditionsErrors = {};\n const initialize = (cond: Condition | ConditionsData): ComplexErrors => {\n if ('rule' in cond) {\n return '';\n }\n\n const nestedErrors: NestedCriteriaErrors = {};\n if (cond.allOf) {\n nestedErrors.allOf = (cond.allOf.map(initialize) as string[]) || [];\n }\n if (cond.anyOf) {\n nestedErrors.anyOf = (cond.anyOf.map(initialize) as string[]) || [];\n }\n if (cond.not) {\n nestedErrors.not = (initialize(cond.not) as string) || '';\n }\n\n return nestedErrors;\n };\n\n if (criteria === criterias.condition) {\n errors.condition = '';\n } else if (criteria === criterias.not) {\n const notCondition = conditions.not;\n\n let notConditionType;\n if (notCondition === undefined) {\n notConditionType = NotConditionType.SimpleCondition;\n } else if ('rule' in notCondition) {\n notConditionType = NotConditionType.SimpleCondition;\n } else {\n notConditionType = NotConditionType.NestedCondition;\n }\n\n if (notConditionType === NotConditionType.SimpleCondition) {\n errors.not = '';\n } else {\n errors.not = initialize(conditions.not!);\n }\n } else if (criteria === criterias.allOf || criteria === criterias.anyOf) {\n errors[criteria] = Array.isArray(conditions[criteria])\n ? (conditions[criteria] as Condition[]).map(initialize)\n : [''];\n }\n\n return errors;\n};\n\nexport const resetErrors = (\n criteria: string,\n notConditionType = NotConditionType.SimpleCondition,\n): AccessConditionsErrors => {\n const errors: AccessConditionsErrors = {};\n\n if (\n criteria === criterias.condition ||\n (criteria === criterias.not &&\n notConditionType === NotConditionType.SimpleCondition)\n ) {\n errors[criteria] = '';\n }\n\n if (criteria === criterias.allOf || criteria === criterias.anyOf) {\n errors[criteria] = [''] as ComplexErrors[];\n }\n\n if (\n criteria === criterias.not &&\n notConditionType === NotConditionType.NestedCondition\n ) {\n (errors[criteria] as ComplexErrors) = { [criterias.allOf]: [''] };\n }\n\n return errors;\n};\n\nexport const setErrorMessage = (errors: RJSFValidationError[]) =>\n errors[0] ? `Error in the ${errors[0].property} field.` : '';\n\nexport const getSimpleRuleErrors = (errors: ComplexErrors[]): string[] =>\n (errors.filter(\n (err: ComplexErrors) => typeof err === 'string',\n ) as string[]) || [];\n\nexport const getNestedRuleErrors = (\n errors: ComplexErrors[],\n): NestedCriteriaErrors[] =>\n (errors.filter(\n (err: ComplexErrors) => typeof err !== 'string',\n ) as NestedCriteriaErrors[]) || [];\n\nexport const isNestedConditionRule = (r: Condition): boolean => {\n return (\n criterias.allOf in (r as ConditionsData) ||\n criterias.anyOf in (r as ConditionsData) ||\n criterias.not in (r as ConditionsData)\n );\n};\n\nexport const getNestedConditionSimpleRulesCount = (\n nc: Condition,\n c: string,\n): number => {\n if (c === criterias.not) {\n return (nc[c as keyof Condition] as PermissionCondition).resourceType\n ? 1\n : 0;\n }\n\n return (nc[c as keyof Condition] as Condition[]).filter(\n r => 'resourceType' in r,\n ).length;\n};\n\nexport const getRowStyle = (c: Condition, isNestedCondition: boolean) =>\n isNestedCondition\n ? {\n display:\n (c as PermissionCondition).rule !== undefined ? 'flex' : 'none',\n }\n : { display: 'flex', gap: '10px' };\n\nexport const getRowKey = (isNestedCondition: boolean, ruleIndex: number) =>\n isNestedCondition\n ? `nestedCondition-rule-${ruleIndex}`\n : `condition-rule-${ruleIndex}`;\n\nexport const hasAllOfOrAnyOfErrors = (\n errors: AccessConditionsErrors,\n criteria: string,\n): boolean => {\n if (!errors) return false;\n\n const criteriaErrors = errors[\n criteria as keyof AccessConditionsErrors\n ] as ComplexErrors[];\n const simpleRuleErrors = criteriaErrors.filter(\n e => typeof e === 'string',\n ) as string[];\n const nestedRuleErrors = criteriaErrors.filter(\n e => typeof e !== 'string',\n ) as NestedCriteriaErrors[];\n\n if (simpleRuleErrors.some(e => e.length > 0)) {\n return true;\n }\n\n return nestedRuleErrors.some(err => {\n const nestedCriteria = Object.keys(err)[0] as keyof NestedCriteriaErrors;\n const nestedErrors = err[nestedCriteria];\n\n if (Array.isArray(nestedErrors)) {\n return nestedErrors.some(e => e.length > 0);\n }\n return nestedErrors?.length > 0;\n });\n};\n\nexport const hasSimpleConditionOrNotErrors = (\n errors: AccessConditionsErrors,\n criteria: string,\n): boolean => {\n if (!errors) return false;\n return (\n ((errors[criteria as keyof AccessConditionsErrors] as string) || '')\n .length > 0\n );\n};\n\nexport const hasNestedNotErrors = (\n errors: AccessConditionsErrors,\n conditions: ConditionsData,\n criteria: keyof ConditionsData,\n): boolean => {\n if (!errors) return false;\n const nestedCriteria = Object.keys(conditions[criteria]!)[0];\n const nestedErrors = (\n errors[\n criterias.not as keyof AccessConditionsErrors\n ] as NestedCriteriaErrors\n )[nestedCriteria];\n\n if (Array.isArray(nestedErrors)) {\n return nestedErrors.some(e => e.length > 0);\n }\n return nestedErrors?.length > 0;\n};\n\nexport const isSimpleRule =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