@backstage-community/plugin-rbac 1.43.0 → 1.45.0

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 (115) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/alpha.d.ts +179 -0
  3. package/dist/alpha.esm.js +3 -0
  4. package/dist/alpha.esm.js.map +1 -0
  5. package/dist/components/ConditionalAccess/AddNestedConditionButton.esm.js +13 -9
  6. package/dist/components/ConditionalAccess/AddNestedConditionButton.esm.js.map +1 -1
  7. package/dist/components/ConditionalAccess/ComplexConditionRow.esm.js +3 -1
  8. package/dist/components/ConditionalAccess/ComplexConditionRow.esm.js.map +1 -1
  9. package/dist/components/ConditionalAccess/ComplexConditionRowButtons.esm.js +5 -3
  10. package/dist/components/ConditionalAccess/ComplexConditionRowButtons.esm.js.map +1 -1
  11. package/dist/components/ConditionalAccess/ConditionalAccessSidebar.esm.js +5 -3
  12. package/dist/components/ConditionalAccess/ConditionalAccessSidebar.esm.js.map +1 -1
  13. package/dist/components/ConditionalAccess/ConditionsFormRow.esm.js +7 -5
  14. package/dist/components/ConditionalAccess/ConditionsFormRow.esm.js.map +1 -1
  15. package/dist/components/ConditionalAccess/ConditionsFormRowFields.esm.js +4 -2
  16. package/dist/components/ConditionalAccess/ConditionsFormRowFields.esm.js.map +1 -1
  17. package/dist/components/ConditionalAccess/const.esm.js +6 -12
  18. package/dist/components/ConditionalAccess/const.esm.js.map +1 -1
  19. package/dist/components/CreateRole/AddMembersForm.esm.js +25 -19
  20. package/dist/components/CreateRole/AddMembersForm.esm.js.map +1 -1
  21. package/dist/components/CreateRole/AddedMembersTable.esm.js +10 -4
  22. package/dist/components/CreateRole/AddedMembersTable.esm.js.map +1 -1
  23. package/dist/components/CreateRole/AddedMembersTableColumn.esm.js +30 -28
  24. package/dist/components/CreateRole/AddedMembersTableColumn.esm.js.map +1 -1
  25. package/dist/components/CreateRole/CancelDialog.esm.js +8 -9
  26. package/dist/components/CreateRole/CancelDialog.esm.js.map +1 -1
  27. package/dist/components/CreateRole/CreateRolePage.esm.js +8 -6
  28. package/dist/components/CreateRole/CreateRolePage.esm.js.map +1 -1
  29. package/dist/components/CreateRole/EditRolePage.esm.js +9 -7
  30. package/dist/components/CreateRole/EditRolePage.esm.js.map +1 -1
  31. package/dist/components/CreateRole/PermissionPoliciesForm.esm.js +9 -3
  32. package/dist/components/CreateRole/PermissionPoliciesForm.esm.js.map +1 -1
  33. package/dist/components/CreateRole/PermissionPoliciesFormNestedRow.esm.js +6 -2
  34. package/dist/components/CreateRole/PermissionPoliciesFormNestedRow.esm.js.map +1 -1
  35. package/dist/components/CreateRole/PermissionPoliciesFormRow.esm.js +8 -4
  36. package/dist/components/CreateRole/PermissionPoliciesFormRow.esm.js.map +1 -1
  37. package/dist/components/CreateRole/PermissionPoliciesFormTable.esm.js +11 -6
  38. package/dist/components/CreateRole/PermissionPoliciesFormTable.esm.js.map +1 -1
  39. package/dist/components/CreateRole/PluginsDropdown.esm.js +4 -2
  40. package/dist/components/CreateRole/PluginsDropdown.esm.js.map +1 -1
  41. package/dist/components/CreateRole/ReviewStep.esm.js +9 -7
  42. package/dist/components/CreateRole/ReviewStep.esm.js.map +1 -1
  43. package/dist/components/CreateRole/RoleDetailsForm.esm.js +8 -6
  44. package/dist/components/CreateRole/RoleDetailsForm.esm.js.map +1 -1
  45. package/dist/components/CreateRole/RoleForm.esm.js +27 -23
  46. package/dist/components/CreateRole/RoleForm.esm.js.map +1 -1
  47. package/dist/components/CreateRole/SelectedPermissionPoliciesColumn.esm.js +24 -22
  48. package/dist/components/CreateRole/SelectedPermissionPoliciesColumn.esm.js.map +1 -1
  49. package/dist/components/DownloadUserStatistics.esm.js +4 -2
  50. package/dist/components/DownloadUserStatistics.esm.js.map +1 -1
  51. package/dist/components/EditRole.esm.js +4 -2
  52. package/dist/components/EditRole.esm.js.map +1 -1
  53. package/dist/components/RbacPage.esm.js +4 -2
  54. package/dist/components/RbacPage.esm.js.map +1 -1
  55. package/dist/components/RoleOverview/AboutCard.esm.js +12 -8
  56. package/dist/components/RoleOverview/AboutCard.esm.js.map +1 -1
  57. package/dist/components/RoleOverview/MembersCard.esm.js +18 -9
  58. package/dist/components/RoleOverview/MembersCard.esm.js.map +1 -1
  59. package/dist/components/RoleOverview/MembersListColumns.esm.js +42 -40
  60. package/dist/components/RoleOverview/MembersListColumns.esm.js.map +1 -1
  61. package/dist/components/RoleOverview/PermissionsCard.esm.js +27 -10
  62. package/dist/components/RoleOverview/PermissionsCard.esm.js.map +1 -1
  63. package/dist/components/RoleOverview/PermissionsListColumns.esm.js +38 -36
  64. package/dist/components/RoleOverview/PermissionsListColumns.esm.js.map +1 -1
  65. package/dist/components/RoleOverview/RoleOverviewPage.esm.js +3 -1
  66. package/dist/components/RoleOverview/RoleOverviewPage.esm.js.map +1 -1
  67. package/dist/components/RolesList/DeleteRole.esm.js +4 -2
  68. package/dist/components/RolesList/DeleteRole.esm.js.map +1 -1
  69. package/dist/components/RolesList/DeleteRoleDialog.esm.js +23 -38
  70. package/dist/components/RolesList/DeleteRoleDialog.esm.js.map +1 -1
  71. package/dist/components/RolesList/RolesList.esm.js +19 -9
  72. package/dist/components/RolesList/RolesList.esm.js.map +1 -1
  73. package/dist/components/RolesList/RolesListColumns.esm.js +63 -61
  74. package/dist/components/RolesList/RolesListColumns.esm.js.map +1 -1
  75. package/dist/components/RolesList/RolesListToolbar.esm.js +20 -10
  76. package/dist/components/RolesList/RolesListToolbar.esm.js.map +1 -1
  77. package/dist/components/Router.esm.js +4 -2
  78. package/dist/components/Router.esm.js.map +1 -1
  79. package/dist/components/Trans.esm.js +22 -0
  80. package/dist/components/Trans.esm.js.map +1 -0
  81. package/dist/hooks/useActionPermissionTooltip.esm.js +10 -5
  82. package/dist/hooks/useActionPermissionTooltip.esm.js.map +1 -1
  83. package/dist/hooks/useLanguage.esm.js +7 -0
  84. package/dist/hooks/useLanguage.esm.js.map +1 -0
  85. package/dist/hooks/useMembers.esm.js +16 -8
  86. package/dist/hooks/useMembers.esm.js.map +1 -1
  87. package/dist/hooks/usePermissionPolicies.esm.js +20 -9
  88. package/dist/hooks/usePermissionPolicies.esm.js.map +1 -1
  89. package/dist/hooks/useTranslation.esm.js +8 -0
  90. package/dist/hooks/useTranslation.esm.js.map +1 -0
  91. package/dist/translations/de.esm.js +176 -0
  92. package/dist/translations/de.esm.js.map +1 -0
  93. package/dist/translations/es.esm.js +176 -0
  94. package/dist/translations/es.esm.js.map +1 -0
  95. package/dist/translations/fr.esm.js +176 -0
  96. package/dist/translations/fr.esm.js.map +1 -0
  97. package/dist/translations/index.esm.js +15 -0
  98. package/dist/translations/index.esm.js.map +1 -0
  99. package/dist/translations/it.esm.js +176 -0
  100. package/dist/translations/it.esm.js.map +1 -0
  101. package/dist/translations/ref.esm.js +215 -0
  102. package/dist/translations/ref.esm.js.map +1 -0
  103. package/dist/utils/conditional-access-utils.esm.js +4 -4
  104. package/dist/utils/conditional-access-utils.esm.js.map +1 -1
  105. package/dist/utils/create-role-utils.esm.js +11 -11
  106. package/dist/utils/create-role-utils.esm.js.map +1 -1
  107. package/dist/utils/filter-table-data.esm.js +4 -3
  108. package/dist/utils/filter-table-data.esm.js.map +1 -1
  109. package/dist/utils/rbac-utils.esm.js +23 -19
  110. package/dist/utils/rbac-utils.esm.js.map +1 -1
  111. package/dist/utils/role-form-utils.esm.js +17 -12
  112. package/dist/utils/role-form-utils.esm.js.map +1 -1
  113. package/dist/utils/string-utils.esm.js +2 -2
  114. package/dist/utils/string-utils.esm.js.map +1 -1
  115. package/package.json +34 -20
@@ -0,0 +1,176 @@
1
+ import { createTranslationMessages } from '@backstage/core-plugin-api/alpha';
2
+ import { rbacTranslationRef } from './ref.esm.js';
3
+
4
+ const rbacTranslationIt = createTranslationMessages({
5
+ ref: rbacTranslationRef,
6
+ full: true,
7
+ messages: {
8
+ "page.title": "RBAC",
9
+ "page.createRole": "Crea ruolo",
10
+ "page.editRole": "Modifica ruolo",
11
+ "table.searchPlaceholder": "Filtra",
12
+ "table.title": "Tutti i ruoli",
13
+ "table.titleWithCount": "Tutti i ruoli ({{count}})",
14
+ "table.headers.name": "Nome",
15
+ "table.headers.usersAndGroups": "Utenti e gruppi",
16
+ "table.headers.accessiblePlugins": "Plugin accessibili",
17
+ "table.headers.actions": "Azioni",
18
+ "table.emptyContent": "Nessun record trovato",
19
+ "table.labelRowsSelect": "Righe",
20
+ "toolbar.createButton": "Crea",
21
+ "toolbar.warning.title": "Impossibile creare il ruolo.",
22
+ "toolbar.warning.message": "Per abilitare il pulsante crea/modifica ruolo, assicurati che gli utenti/gruppi richiesti siano disponibili nel catalogo poich\xE9 un ruolo non pu\xF2 essere creato senza utenti/gruppi e anche il ruolo associato al tuo utente dovrebbe avere le politiche di permesso menzionate <link>qui</link>.",
23
+ "toolbar.warning.linkText": "qui",
24
+ "toolbar.warning.note": "Nota",
25
+ "toolbar.warning.noteText": "Anche dopo aver ingerito utenti/gruppi nel catalogo e applicato i permessi sopra menzionati, se il pulsante crea/modifica \xE8 ancora disabilitato, contatta il tuo amministratore poich\xE9 potresti essere condizionalmente limitato dall'accesso al pulsante crea/modifica.",
26
+ "errors.notFound": "Non trovato",
27
+ "errors.unauthorized": "Non autorizzato a creare un ruolo",
28
+ "errors.rbacDisabled": "Abilita il plugin backend RBAC per utilizzare questa funzionalit\xE0.",
29
+ "errors.rbacDisabledInfo": "Per abilitare RBAC, imposta `permission.enabled` su `true` nel file di configurazione dell'app.",
30
+ "errors.fetchRoles": "Qualcosa \xE8 andato storto durante il recupero dei ruoli",
31
+ "errors.fetchRole": "Qualcosa \xE8 andato storto durante il recupero del ruolo",
32
+ "errors.fetchPolicies": "Qualcosa \xE8 andato storto durante il recupero delle politiche di permesso",
33
+ "errors.fetchPoliciesErr": "Errore nel recupero delle politiche. {{error}}",
34
+ "errors.fetchPlugins": "Errore nel recupero dei plugin. {{error}}",
35
+ "errors.fetchConditionalPermissionPolicies": "Errore nel recupero delle politiche di permessi condizionali. {{error}}",
36
+ "errors.fetchConditions": "Qualcosa \xE8 andato storto durante il recupero delle condizioni del ruolo",
37
+ "errors.fetchUsersAndGroups": "Qualcosa \xE8 andato storto durante il recupero di utenti e gruppi",
38
+ "errors.createRole": "Impossibile creare il ruolo.",
39
+ "errors.editRole": "Impossibile modificare il ruolo.",
40
+ "errors.deleteRole": "Impossibile eliminare il ruolo.",
41
+ "errors.roleCreatedSuccess": "Il ruolo \xE8 stato creato con successo ma impossibile aggiungere le politiche di permesso al ruolo.",
42
+ "errors.roleCreatedConditionsSuccess": "Il ruolo \xE8 stato creato con successo ma impossibile aggiungere condizioni al ruolo.",
43
+ "roleForm.titles.createRole": "Crea ruolo",
44
+ "roleForm.titles.editRole": "Modifica ruolo",
45
+ "roleForm.titles.nameAndDescription": "Inserisci nome e descrizione del ruolo",
46
+ "roleForm.titles.usersAndGroups": "Aggiungi utenti e gruppi",
47
+ "roleForm.titles.permissionPolicies": "Aggiungi politiche di permesso",
48
+ "roleForm.review.reviewAndCreate": "Rivedi e crea",
49
+ "roleForm.review.reviewAndSave": "Rivedi e salva",
50
+ "roleForm.review.nameDescriptionOwner": "Nome, descrizione e proprietario del ruolo",
51
+ "roleForm.steps.next": "Avanti",
52
+ "roleForm.steps.back": "Indietro",
53
+ "roleForm.steps.cancel": "Annulla",
54
+ "roleForm.steps.reset": "Reimposta",
55
+ "roleForm.steps.create": "Crea",
56
+ "roleForm.steps.update": "Aggiorna",
57
+ "roleForm.fields.name.label": "Nome",
58
+ "roleForm.fields.name.helperText": "Inserisci il nome del ruolo",
59
+ "roleForm.fields.description.label": "Descrizione",
60
+ "roleForm.fields.description.helperText": "Inserisci una breve descrizione del ruolo (Lo scopo del ruolo)",
61
+ "roleForm.fields.owner.label": "Proprietario",
62
+ "roleForm.fields.owner.helperText": "Opzionale: Inserisci un utente o gruppo che avr\xE0 il permesso di modificare questo ruolo e creare ruoli aggiuntivi. Nel prossimo passo, specifica quali utenti possono assegnare ai loro ruoli e a quali plugin possono concedere accesso. Se lasciato vuoto, assegna automaticamente l'autore alla creazione.",
63
+ "deleteDialog.title": "Elimina ruolo",
64
+ "deleteDialog.question": "Eliminare questo ruolo?",
65
+ "deleteDialog.confirmation": "Sei sicuro di voler eliminare il ruolo **{{roleName}}**?\n\nEliminare questo ruolo \xE8 irreversibile e rimuover\xE0 la sua funzionalit\xE0 dal sistema. Procedi con cautela.\n\nGli **{{members}}** associati a questo ruolo perderanno l'accesso a tutte le **{{permissions}} politiche di permesso** specificate in questo ruolo.",
66
+ "deleteDialog.roleNameLabel": "Nome del ruolo",
67
+ "deleteDialog.roleNameHelper": "Digita il nome del ruolo per confermare",
68
+ "deleteDialog.deleteButton": "Elimina",
69
+ "deleteDialog.cancelButton": "Annulla",
70
+ "deleteDialog.successMessage": "Ruolo {{roleName}} eliminato con successo",
71
+ "snackbar.success": "Successo",
72
+ "common.noResults": "Nessun risultato per questo intervallo di date.",
73
+ "common.exportCSV": "Esporta CSV",
74
+ "common.csvFilename": "esportazione-dati.csv",
75
+ "common.noMembers": "Nessun membro",
76
+ "common.groups": "gruppi",
77
+ "common.group": "gruppo",
78
+ "common.users": "utenti",
79
+ "common.user": "utente",
80
+ "common.use": "Usa",
81
+ "common.refresh": "Aggiorna",
82
+ "common.edit": "Modifica",
83
+ "common.unauthorizedToEdit": "Non autorizzato a modificare",
84
+ "common.noRecordsFound": "Nessun record trovato",
85
+ "common.selectUsersAndGroups": "Seleziona utenti e gruppi",
86
+ "common.clearSearch": "cancella ricerca",
87
+ "common.closeDrawer": "Chiudi il cassetto",
88
+ "common.remove": "Rimuovi",
89
+ "common.addRule": "Aggiungi regola",
90
+ "common.selectRule": "Seleziona una regola",
91
+ "common.rule": "Regola",
92
+ "common.removeNestedCondition": "Rimuovi condizione annidata",
93
+ "common.overview": "Panoramica",
94
+ "common.about": "Informazioni",
95
+ "common.description": "Descrizione",
96
+ "common.modifiedBy": "Modificato da",
97
+ "common.lastModified": "Ultima modifica",
98
+ "common.owner": "Proprietario",
99
+ "common.noUsersAndGroupsSelected": "Nessun utente e gruppo selezionato",
100
+ "common.selectedUsersAndGroupsAppearHere": "Gli utenti e gruppi selezionati appaiono qui.",
101
+ "common.name": "Nome",
102
+ "common.type": "Tipo",
103
+ "common.members": "Membri",
104
+ "common.actions": "Azioni",
105
+ "common.removeMember": "Rimuovi membro",
106
+ "common.delete": "Elimina",
107
+ "common.deleteRole": "Elimina ruolo",
108
+ "common.update": "Aggiorna",
109
+ "common.editRole": "Modifica ruolo",
110
+ "common.checkingPermissions": "Controllo dei permessi\u2026",
111
+ "common.unauthorizedTo": "Non autorizzato per {{action}}",
112
+ "common.performThisAction": "eseguire questa azione",
113
+ "common.unableToCreatePermissionPolicies": "Impossibile creare le politiche di permessi.",
114
+ "common.unableToDeletePermissionPolicies": "Impossibile eliminare le politiche di permessi.",
115
+ "common.unableToRemoveConditions": "Impossibile rimuovere le condizioni dal ruolo.",
116
+ "common.unableToUpdateConditions": "Impossibile aggiornare le condizioni.",
117
+ "common.unableToAddConditions": "Impossibile aggiungere condizioni al ruolo.",
118
+ "common.roleActionSuccessfully": "Ruolo {{roleName}} {{action}} con successo",
119
+ "common.unableToFetchRole": "Impossibile recuperare il ruolo: {{error}}",
120
+ "common.unableToFetchMembers": "Impossibile recuperare i membri: {{error}}",
121
+ "common.roleAction": "{{action}} ruolo",
122
+ "common.membersCount": "{{count}} membri",
123
+ "common.parentGroupCount": "{{count}} gruppo padre",
124
+ "common.childGroupsCount": "{{count}} gruppi figli",
125
+ "common.searchAndSelectUsersGroups": "Cerca e seleziona utenti e gruppi da aggiungere. Gli utenti e gruppi selezionati appariranno nella tabella sottostante.",
126
+ "common.noUsersAndGroupsFound": "Nessun utente e gruppo trovato.",
127
+ "common.errorFetchingUserGroups": "Errore nel recupero di utenti e gruppi: {{error}}",
128
+ "common.nameRequired": "Il nome \xE8 richiesto",
129
+ "common.noMemberSelected": "Nessun membro selezionato",
130
+ "common.noPluginSelected": "Nessun plugin selezionato",
131
+ "common.pluginRequired": "Il plugin \xE8 richiesto",
132
+ "common.permissionRequired": "Il permesso \xE8 richiesto",
133
+ "common.editCell": "Modifica...",
134
+ "common.selectCell": "Seleziona...",
135
+ "common.expandRow": "espandi riga",
136
+ "common.configureAccessFor": "Configura accesso per",
137
+ "common.defaultResourceTypeVisible": "Per impostazione predefinita, il tipo di risorsa selezionato \xE8 visibile a tutti gli utenti aggiunti. Se vuoi limitare o concedere permessi a regole di plugin specifiche, selezionale e aggiungi i parametri.",
138
+ "conditionalAccess.condition": "Condizione",
139
+ "conditionalAccess.allOf": "AllOf",
140
+ "conditionalAccess.anyOf": "AnyOf",
141
+ "conditionalAccess.not": "Not",
142
+ "conditionalAccess.addNestedCondition": "Aggiungi condizione annidata",
143
+ "conditionalAccess.addRule": "Aggiungi regola",
144
+ "conditionalAccess.nestedConditionTooltip": "Le condizioni annidate sono **regole di 1 livello all'interno di una condizione principale**. Ti permettono di consentire un accesso appropriato utilizzando permessi dettagliati basati su varie condizioni. Puoi aggiungere pi\xF9 condizioni annidate.",
145
+ "conditionalAccess.nestedConditionExample": "Ad esempio, puoi consentire l'accesso a tutti i tipi di entit\xE0 nella condizione principale e utilizzare una condizione annidata per limitare l'accesso alle entit\xE0 di propriet\xE0 dell'utente.",
146
+ "dialog.cancelRoleCreation": "Annulla creazione ruolo",
147
+ "dialog.exitRoleCreation": "Uscire dalla creazione del ruolo?",
148
+ "dialog.exitRoleEditing": "Uscire dalla modifica del ruolo?",
149
+ "dialog.exitWarning": "\n\nUscire da questa pagina scarter\xE0 permanentemente le informazioni inserite.\n\nSei sicuro di voler uscire?",
150
+ "dialog.discard": "Scarta",
151
+ "dialog.cancel": "Annulla",
152
+ "permissionPolicies.helperText": "Per impostazione predefinita, agli utenti non viene concesso l'accesso a nessun plugin. Per concedere l'accesso agli utenti, seleziona i plugin che vuoi abilitare. Quindi, seleziona le azioni che vuoi autorizzare per l'utente.",
153
+ "permissionPolicies.allPlugins": "Tutti i plugin ({{count}})",
154
+ "permissionPolicies.errorFetchingPolicies": "Errore nel recupero delle politiche di permessi: {{error}}",
155
+ "permissionPolicies.resourceTypeTooltip": "tipo di risorsa: {{resourceType}}",
156
+ "permissionPolicies.advancedPermissionsTooltip": "Usa permessi personalizzati avanzati per consentire l'accesso a parti specifiche del tipo di risorsa selezionato.",
157
+ "permissionPolicies.pluginsSelected": "{{count}} plugin",
158
+ "permissionPolicies.noPluginsSelected": "Nessun plugin selezionato",
159
+ "permissionPolicies.search": "Cerca",
160
+ "permissionPolicies.noRecordsToDisplay": "Nessun record da visualizzare.",
161
+ "permissionPolicies.selectedPluginsAppearHere": "I plugin selezionati appaiono qui.",
162
+ "permissionPolicies.selectPlugins": "Seleziona plugin",
163
+ "permissionPolicies.noPluginsFound": "Nessun plugin trovato.",
164
+ "permissionPolicies.plugin": "Plugin",
165
+ "permissionPolicies.permission": "Permesso",
166
+ "permissionPolicies.policies": "Politiche",
167
+ "permissionPolicies.conditional": "Condizionale",
168
+ "permissionPolicies.rules": "regole",
169
+ "permissionPolicies.rule": "regola",
170
+ "permissionPolicies.permissionPolicies": "Politiche di permessi",
171
+ "permissionPolicies.permissions": "permessi"
172
+ }
173
+ });
174
+
175
+ export { rbacTranslationIt as default };
176
+ //# sourceMappingURL=it.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it.esm.js","sources":["../../src/translations/it.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 { createTranslationMessages } from '@backstage/core-plugin-api/alpha';\nimport { rbacTranslationRef } from './ref';\n\nconst rbacTranslationIt = createTranslationMessages({\n ref: rbacTranslationRef,\n full: true,\n messages: {\n 'page.title': 'RBAC',\n 'page.createRole': 'Crea ruolo',\n 'page.editRole': 'Modifica ruolo',\n 'table.searchPlaceholder': 'Filtra',\n 'table.title': 'Tutti i ruoli',\n 'table.titleWithCount': 'Tutti i ruoli ({{count}})',\n 'table.headers.name': 'Nome',\n 'table.headers.usersAndGroups': 'Utenti e gruppi',\n 'table.headers.accessiblePlugins': 'Plugin accessibili',\n 'table.headers.actions': 'Azioni',\n 'table.emptyContent': 'Nessun record trovato',\n 'table.labelRowsSelect': 'Righe',\n 'toolbar.createButton': 'Crea',\n 'toolbar.warning.title': 'Impossibile creare il ruolo.',\n 'toolbar.warning.message':\n 'Per abilitare il pulsante crea/modifica ruolo, assicurati che gli utenti/gruppi richiesti siano disponibili nel catalogo poiché un ruolo non può essere creato senza utenti/gruppi e anche il ruolo associato al tuo utente dovrebbe avere le politiche di permesso menzionate <link>qui</link>.',\n 'toolbar.warning.linkText': 'qui',\n 'toolbar.warning.note': 'Nota',\n 'toolbar.warning.noteText':\n \"Anche dopo aver ingerito utenti/gruppi nel catalogo e applicato i permessi sopra menzionati, se il pulsante crea/modifica è ancora disabilitato, contatta il tuo amministratore poiché potresti essere condizionalmente limitato dall'accesso al pulsante crea/modifica.\",\n 'errors.notFound': 'Non trovato',\n 'errors.unauthorized': 'Non autorizzato a creare un ruolo',\n 'errors.rbacDisabled':\n 'Abilita il plugin backend RBAC per utilizzare questa funzionalità.',\n 'errors.rbacDisabledInfo':\n \"Per abilitare RBAC, imposta `permission.enabled` su `true` nel file di configurazione dell'app.\",\n 'errors.fetchRoles':\n 'Qualcosa è andato storto durante il recupero dei ruoli',\n 'errors.fetchRole':\n 'Qualcosa è andato storto durante il recupero del ruolo',\n 'errors.fetchPolicies':\n 'Qualcosa è andato storto durante il recupero delle politiche di permesso',\n 'errors.fetchPoliciesErr': 'Errore nel recupero delle politiche. {{error}}',\n 'errors.fetchPlugins': 'Errore nel recupero dei plugin. {{error}}',\n 'errors.fetchConditionalPermissionPolicies':\n 'Errore nel recupero delle politiche di permessi condizionali. {{error}}',\n 'errors.fetchConditions':\n 'Qualcosa è andato storto durante il recupero delle condizioni del ruolo',\n 'errors.fetchUsersAndGroups':\n 'Qualcosa è andato storto durante il recupero di utenti e gruppi',\n 'errors.createRole': 'Impossibile creare il ruolo.',\n 'errors.editRole': 'Impossibile modificare il ruolo.',\n 'errors.deleteRole': 'Impossibile eliminare il ruolo.',\n 'errors.roleCreatedSuccess':\n 'Il ruolo è stato creato con successo ma impossibile aggiungere le politiche di permesso al ruolo.',\n 'errors.roleCreatedConditionsSuccess':\n 'Il ruolo è stato creato con successo ma impossibile aggiungere condizioni al ruolo.',\n 'roleForm.titles.createRole': 'Crea ruolo',\n 'roleForm.titles.editRole': 'Modifica ruolo',\n 'roleForm.titles.nameAndDescription':\n 'Inserisci nome e descrizione del ruolo',\n 'roleForm.titles.usersAndGroups': 'Aggiungi utenti e gruppi',\n 'roleForm.titles.permissionPolicies': 'Aggiungi politiche di permesso',\n 'roleForm.review.reviewAndCreate': 'Rivedi e crea',\n 'roleForm.review.reviewAndSave': 'Rivedi e salva',\n 'roleForm.review.nameDescriptionOwner':\n 'Nome, descrizione e proprietario del ruolo',\n 'roleForm.steps.next': 'Avanti',\n 'roleForm.steps.back': 'Indietro',\n 'roleForm.steps.cancel': 'Annulla',\n 'roleForm.steps.reset': 'Reimposta',\n 'roleForm.steps.create': 'Crea',\n 'roleForm.steps.update': 'Aggiorna',\n 'roleForm.fields.name.label': 'Nome',\n 'roleForm.fields.name.helperText': 'Inserisci il nome del ruolo',\n 'roleForm.fields.description.label': 'Descrizione',\n 'roleForm.fields.description.helperText':\n 'Inserisci una breve descrizione del ruolo (Lo scopo del ruolo)',\n 'roleForm.fields.owner.label': 'Proprietario',\n 'roleForm.fields.owner.helperText':\n \"Opzionale: Inserisci un utente o gruppo che avrà il permesso di modificare questo ruolo e creare ruoli aggiuntivi. Nel prossimo passo, specifica quali utenti possono assegnare ai loro ruoli e a quali plugin possono concedere accesso. Se lasciato vuoto, assegna automaticamente l'autore alla creazione.\",\n 'deleteDialog.title': 'Elimina ruolo',\n 'deleteDialog.question': 'Eliminare questo ruolo?',\n 'deleteDialog.confirmation':\n \"Sei sicuro di voler eliminare il ruolo **{{roleName}}**?\\n\\nEliminare questo ruolo è irreversibile e rimuoverà la sua funzionalità dal sistema. Procedi con cautela.\\n\\nGli **{{members}}** associati a questo ruolo perderanno l'accesso a tutte le **{{permissions}} politiche di permesso** specificate in questo ruolo.\",\n 'deleteDialog.roleNameLabel': 'Nome del ruolo',\n 'deleteDialog.roleNameHelper': 'Digita il nome del ruolo per confermare',\n 'deleteDialog.deleteButton': 'Elimina',\n 'deleteDialog.cancelButton': 'Annulla',\n 'deleteDialog.successMessage': 'Ruolo {{roleName}} eliminato con successo',\n 'snackbar.success': 'Successo',\n 'common.noResults': 'Nessun risultato per questo intervallo di date.',\n 'common.exportCSV': 'Esporta CSV',\n 'common.csvFilename': 'esportazione-dati.csv',\n 'common.noMembers': 'Nessun membro',\n 'common.groups': 'gruppi',\n 'common.group': 'gruppo',\n 'common.users': 'utenti',\n 'common.user': 'utente',\n 'common.use': 'Usa',\n 'common.refresh': 'Aggiorna',\n 'common.edit': 'Modifica',\n 'common.unauthorizedToEdit': 'Non autorizzato a modificare',\n 'common.noRecordsFound': 'Nessun record trovato',\n 'common.selectUsersAndGroups': 'Seleziona utenti e gruppi',\n 'common.clearSearch': 'cancella ricerca',\n 'common.closeDrawer': 'Chiudi il cassetto',\n 'common.remove': 'Rimuovi',\n 'common.addRule': 'Aggiungi regola',\n 'common.selectRule': 'Seleziona una regola',\n 'common.rule': 'Regola',\n 'common.removeNestedCondition': 'Rimuovi condizione annidata',\n 'common.overview': 'Panoramica',\n 'common.about': 'Informazioni',\n 'common.description': 'Descrizione',\n 'common.modifiedBy': 'Modificato da',\n 'common.lastModified': 'Ultima modifica',\n 'common.owner': 'Proprietario',\n 'common.noUsersAndGroupsSelected': 'Nessun utente e gruppo selezionato',\n 'common.selectedUsersAndGroupsAppearHere':\n 'Gli utenti e gruppi selezionati appaiono qui.',\n 'common.name': 'Nome',\n 'common.type': 'Tipo',\n 'common.members': 'Membri',\n 'common.actions': 'Azioni',\n 'common.removeMember': 'Rimuovi membro',\n 'common.delete': 'Elimina',\n 'common.deleteRole': 'Elimina ruolo',\n 'common.update': 'Aggiorna',\n 'common.editRole': 'Modifica ruolo',\n 'common.checkingPermissions': 'Controllo dei permessi…',\n 'common.unauthorizedTo': 'Non autorizzato per {{action}}',\n 'common.performThisAction': 'eseguire questa azione',\n 'common.unableToCreatePermissionPolicies':\n 'Impossibile creare le politiche di permessi.',\n 'common.unableToDeletePermissionPolicies':\n 'Impossibile eliminare le politiche di permessi.',\n 'common.unableToRemoveConditions':\n 'Impossibile rimuovere le condizioni dal ruolo.',\n 'common.unableToUpdateConditions': 'Impossibile aggiornare le condizioni.',\n 'common.unableToAddConditions':\n 'Impossibile aggiungere condizioni al ruolo.',\n 'common.roleActionSuccessfully':\n 'Ruolo {{roleName}} {{action}} con successo',\n 'common.unableToFetchRole': 'Impossibile recuperare il ruolo: {{error}}',\n 'common.unableToFetchMembers': 'Impossibile recuperare i membri: {{error}}',\n 'common.roleAction': '{{action}} ruolo',\n 'common.membersCount': '{{count}} membri',\n 'common.parentGroupCount': '{{count}} gruppo padre',\n 'common.childGroupsCount': '{{count}} gruppi figli',\n 'common.searchAndSelectUsersGroups':\n 'Cerca e seleziona utenti e gruppi da aggiungere. Gli utenti e gruppi selezionati appariranno nella tabella sottostante.',\n 'common.noUsersAndGroupsFound': 'Nessun utente e gruppo trovato.',\n 'common.errorFetchingUserGroups':\n 'Errore nel recupero di utenti e gruppi: {{error}}',\n 'common.nameRequired': 'Il nome è richiesto',\n 'common.noMemberSelected': 'Nessun membro selezionato',\n 'common.noPluginSelected': 'Nessun plugin selezionato',\n 'common.pluginRequired': 'Il plugin è richiesto',\n 'common.permissionRequired': 'Il permesso è richiesto',\n 'common.editCell': 'Modifica...',\n 'common.selectCell': 'Seleziona...',\n 'common.expandRow': 'espandi riga',\n 'common.configureAccessFor': 'Configura accesso per',\n 'common.defaultResourceTypeVisible':\n 'Per impostazione predefinita, il tipo di risorsa selezionato è visibile a tutti gli utenti aggiunti. Se vuoi limitare o concedere permessi a regole di plugin specifiche, selezionale e aggiungi i parametri.',\n 'conditionalAccess.condition': 'Condizione',\n 'conditionalAccess.allOf': 'AllOf',\n 'conditionalAccess.anyOf': 'AnyOf',\n 'conditionalAccess.not': 'Not',\n 'conditionalAccess.addNestedCondition': 'Aggiungi condizione annidata',\n 'conditionalAccess.addRule': 'Aggiungi regola',\n 'conditionalAccess.nestedConditionTooltip':\n \"Le condizioni annidate sono **regole di 1 livello all'interno di una condizione principale**. Ti permettono di consentire un accesso appropriato utilizzando permessi dettagliati basati su varie condizioni. Puoi aggiungere più condizioni annidate.\",\n 'conditionalAccess.nestedConditionExample':\n \"Ad esempio, puoi consentire l'accesso a tutti i tipi di entità nella condizione principale e utilizzare una condizione annidata per limitare l'accesso alle entità di proprietà dell'utente.\",\n 'dialog.cancelRoleCreation': 'Annulla creazione ruolo',\n 'dialog.exitRoleCreation': 'Uscire dalla creazione del ruolo?',\n 'dialog.exitRoleEditing': 'Uscire dalla modifica del ruolo?',\n 'dialog.exitWarning':\n '\\n\\nUscire da questa pagina scarterà permanentemente le informazioni inserite.\\n\\nSei sicuro di voler uscire?',\n 'dialog.discard': 'Scarta',\n 'dialog.cancel': 'Annulla',\n 'permissionPolicies.helperText':\n \"Per impostazione predefinita, agli utenti non viene concesso l'accesso a nessun plugin. Per concedere l'accesso agli utenti, seleziona i plugin che vuoi abilitare. Quindi, seleziona le azioni che vuoi autorizzare per l'utente.\",\n 'permissionPolicies.allPlugins': 'Tutti i plugin ({{count}})',\n 'permissionPolicies.errorFetchingPolicies':\n 'Errore nel recupero delle politiche di permessi: {{error}}',\n 'permissionPolicies.resourceTypeTooltip':\n 'tipo di risorsa: {{resourceType}}',\n 'permissionPolicies.advancedPermissionsTooltip':\n \"Usa permessi personalizzati avanzati per consentire l'accesso a parti specifiche del tipo di risorsa selezionato.\",\n 'permissionPolicies.pluginsSelected': '{{count}} plugin',\n 'permissionPolicies.noPluginsSelected': 'Nessun plugin selezionato',\n 'permissionPolicies.search': 'Cerca',\n 'permissionPolicies.noRecordsToDisplay': 'Nessun record da visualizzare.',\n 'permissionPolicies.selectedPluginsAppearHere':\n 'I plugin selezionati appaiono qui.',\n 'permissionPolicies.selectPlugins': 'Seleziona plugin',\n 'permissionPolicies.noPluginsFound': 'Nessun plugin trovato.',\n 'permissionPolicies.plugin': 'Plugin',\n 'permissionPolicies.permission': 'Permesso',\n 'permissionPolicies.policies': 'Politiche',\n 'permissionPolicies.conditional': 'Condizionale',\n 'permissionPolicies.rules': 'regole',\n 'permissionPolicies.rule': 'regola',\n 'permissionPolicies.permissionPolicies': 'Politiche di permessi',\n 'permissionPolicies.permissions': 'permessi',\n },\n});\n\nexport default rbacTranslationIt;\n"],"names":[],"mappings":";;;AAkBA,MAAM,oBAAoB,yBAA0B,CAAA;AAAA,EAClD,GAAK,EAAA,kBAAA;AAAA,EACL,IAAM,EAAA,IAAA;AAAA,EACN,QAAU,EAAA;AAAA,IACR,YAAc,EAAA,MAAA;AAAA,IACd,iBAAmB,EAAA,YAAA;AAAA,IACnB,eAAiB,EAAA,gBAAA;AAAA,IACjB,yBAA2B,EAAA,QAAA;AAAA,IAC3B,aAAe,EAAA,eAAA;AAAA,IACf,sBAAwB,EAAA,2BAAA;AAAA,IACxB,oBAAsB,EAAA,MAAA;AAAA,IACtB,8BAAgC,EAAA,iBAAA;AAAA,IAChC,iCAAmC,EAAA,oBAAA;AAAA,IACnC,uBAAyB,EAAA,QAAA;AAAA,IACzB,oBAAsB,EAAA,uBAAA;AAAA,IACtB,uBAAyB,EAAA,OAAA;AAAA,IACzB,sBAAwB,EAAA,MAAA;AAAA,IACxB,uBAAyB,EAAA,8BAAA;AAAA,IACzB,yBACE,EAAA,wSAAA;AAAA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acMessages = {
4
+ page: {
5
+ title: "RBAC",
6
+ createRole: "Create role",
7
+ editRole: "Edit role"
8
+ },
9
+ table: {
10
+ searchPlaceholder: "Filter",
11
+ labelRowsSelect: "Rows",
12
+ title: "All roles",
13
+ titleWithCount: "All roles ({{count}})",
14
+ headers: {
15
+ name: "Name",
16
+ usersAndGroups: "Users and groups",
17
+ accessiblePlugins: "Accessible plugins",
18
+ actions: "Actions"
19
+ },
20
+ emptyContent: "No records found"
21
+ },
22
+ toolbar: {
23
+ createButton: "Create",
24
+ warning: {
25
+ title: "Unable to create role.",
26
+ message: "To enable create/edit role button, make sure required users/groups are available in catalog as a role cannot be created without users/groups and also the role associated with your user should have the permission policies mentioned <link>here</link>.",
27
+ linkText: "here",
28
+ note: "Note",
29
+ noteText: "Even after ingesting users/groups in catalog and applying above permissions if the create/edit button is still disabled then please contact your administrator as you might be conditionally restricted from accessing the create/edit button."
30
+ }
31
+ },
32
+ errors: {
33
+ notFound: "Not Found",
34
+ unauthorized: "Unauthorized to create role",
35
+ rbacDisabled: "Enable the RBAC backend plugin to use this feature.",
36
+ rbacDisabledInfo: "To enable RBAC, set `permission.enabled` to `true` in the app-config file.",
37
+ fetchRoles: "Something went wrong while fetching the roles",
38
+ fetchRole: "Something went wrong while fetching the role",
39
+ fetchPoliciesErr: "Error fetching the policies. {{error}}",
40
+ fetchPolicies: "Something went wrong while fetching the permission policies",
41
+ fetchPlugins: "Error fetching the plugins. {{error}}",
42
+ fetchConditionalPermissionPolicies: "Error fetching the conditional permission policies. {{error}}",
43
+ fetchConditions: "Something went wrong while fetching the role conditions",
44
+ fetchUsersAndGroups: "Something went wrong while fetching the users and groups",
45
+ createRole: "Unable to create role.",
46
+ editRole: "Unable to edit the role.",
47
+ deleteRole: "Unable to delete the role.",
48
+ roleCreatedSuccess: "Role was created successfully but unable to add permission policies to the role.",
49
+ roleCreatedConditionsSuccess: "Role created successfully but unable to add conditions to the role."
50
+ },
51
+ roleForm: {
52
+ titles: {
53
+ createRole: "Create Role",
54
+ editRole: "Edit Role",
55
+ nameAndDescription: "Enter name and description of role",
56
+ usersAndGroups: "Add users and groups",
57
+ permissionPolicies: "Add permission policies"
58
+ },
59
+ review: {
60
+ reviewAndCreate: "Review and create",
61
+ reviewAndSave: "Review and save",
62
+ nameDescriptionOwner: "Name, description, and owner of role"
63
+ },
64
+ steps: {
65
+ next: "Next",
66
+ back: "Back",
67
+ cancel: "Cancel",
68
+ reset: "Reset",
69
+ create: "Create",
70
+ update: "Update"
71
+ },
72
+ fields: {
73
+ name: {
74
+ label: "Name",
75
+ helperText: "Enter name of the role"
76
+ },
77
+ description: {
78
+ label: "Description",
79
+ helperText: "Enter a brief description about the role (The purpose of the role)"
80
+ },
81
+ owner: {
82
+ label: "Owner",
83
+ helperText: "Optional: Enter a user or group who will have permission to edit this role and create additional roles. In the next step, specify which users they can assign to their roles and which plugins they can grant access to. If left blank, automatically assigns the author at creation."
84
+ }
85
+ }
86
+ },
87
+ deleteDialog: {
88
+ title: "Delete Role",
89
+ question: "Delete this role?",
90
+ confirmation: "Are you sure you want to delete the role **{{roleName}}**?\n\nDeleting this role is irreversible and will remove its functionality from the system. Proceed with caution.\n\nThe **{{members}}** associated with this role will lose access to all the **{{permissions}} permission policies** specified in this role.",
91
+ roleNameLabel: "Role name",
92
+ roleNameHelper: "Type the name of the role to confirm",
93
+ deleteButton: "Delete",
94
+ cancelButton: "Cancel",
95
+ successMessage: "Role {{roleName}} deleted successfully"
96
+ },
97
+ snackbar: {
98
+ success: "Success"
99
+ },
100
+ dialog: {
101
+ cancelRoleCreation: "Cancel role creation",
102
+ exitRoleCreation: "Exit role creation?",
103
+ exitRoleEditing: "Exit role editing?",
104
+ exitWarning: "\n\nExiting this page will permanently discard the information you entered.\n\nAre you sure you want to exit?",
105
+ discard: "Discard",
106
+ cancel: "Cancel"
107
+ },
108
+ conditionalAccess: {
109
+ condition: "Condition",
110
+ allOf: "AllOf",
111
+ anyOf: "AnyOf",
112
+ not: "Not",
113
+ addNestedCondition: "Add nested condition",
114
+ addRule: "Add rule",
115
+ nestedConditionTooltip: "Nested conditions are **1 layer rules within a main condition**. It lets you allow appropriate access by using detailed permissions based on various conditions. You can add multiple nested conditions.",
116
+ nestedConditionExample: "For example, you can allow access to all entity types in the main condition and use a nested condition to limit the access to entities owned by the user."
117
+ },
118
+ permissionPolicies: {
119
+ helperText: "By default, users are not granted access to any plugins. To grant user access, select the plugins you want to enable. Then, select which actions you would like to give user permission to.",
120
+ allPlugins: "All plugins ({{count}})",
121
+ errorFetchingPolicies: "Error fetching the permission policies: {{error}}",
122
+ resourceTypeTooltip: "resource type: {{resourceType}}",
123
+ advancedPermissionsTooltip: "Use advanced customized permissions to allow access to specific parts of the selected resource type.",
124
+ pluginsSelected: "{{count}} plugins",
125
+ noPluginsSelected: "No plugins selected",
126
+ search: "Search",
127
+ noRecordsToDisplay: "No records to display.",
128
+ selectedPluginsAppearHere: "Selected plugins appear here.",
129
+ selectPlugins: "Select plugins",
130
+ noPluginsFound: "No plugins found.",
131
+ plugin: "Plugin",
132
+ permission: "Permission",
133
+ policies: "Policies",
134
+ conditional: "Conditional",
135
+ rules: "rules",
136
+ rule: "rule",
137
+ permissionPolicies: "Permission Policies",
138
+ permissions: "permissions"
139
+ },
140
+ common: {
141
+ noResults: "No results for this date range.",
142
+ exportCSV: "Export CSV",
143
+ csvFilename: "data-export.csv",
144
+ noMembers: "No members",
145
+ groups: "groups",
146
+ group: "group",
147
+ users: "users",
148
+ user: "user",
149
+ use: "Use",
150
+ refresh: "Refresh",
151
+ edit: "Edit",
152
+ unauthorizedToEdit: "Unauthorized to edit",
153
+ noRecordsFound: "No records found",
154
+ selectUsersAndGroups: "Select users and groups",
155
+ clearSearch: "clear search",
156
+ closeDrawer: "Close the drawer",
157
+ remove: "Remove",
158
+ addRule: "Add rule",
159
+ selectRule: "Select a rule",
160
+ rule: "Rule",
161
+ removeNestedCondition: "Remove nested condition",
162
+ overview: "Overview",
163
+ about: "About",
164
+ description: "Description",
165
+ modifiedBy: "Modified By",
166
+ lastModified: "Last Modified",
167
+ owner: "Owner",
168
+ noUsersAndGroupsSelected: "No users and groups selected",
169
+ selectedUsersAndGroupsAppearHere: "Selected users and groups appear here.",
170
+ name: "Name",
171
+ type: "Type",
172
+ members: "Members",
173
+ actions: "Actions",
174
+ removeMember: "Remove member",
175
+ delete: "Delete",
176
+ deleteRole: "Delete Role",
177
+ update: "Update",
178
+ editRole: "Edit Role",
179
+ checkingPermissions: "Checking permissions\u2026",
180
+ unauthorizedTo: "Unauthorized to {{action}}",
181
+ performThisAction: "perform this action",
182
+ unableToCreatePermissionPolicies: "Unable to create the permission policies.",
183
+ unableToDeletePermissionPolicies: "Unable to delete the permission policies.",
184
+ unableToRemoveConditions: "Unable to remove conditions from the role.",
185
+ unableToUpdateConditions: "Unable to update conditions.",
186
+ unableToAddConditions: "Unable to add conditions to the role.",
187
+ roleActionSuccessfully: "Role {{roleName}} {{action}} successfully",
188
+ unableToFetchRole: "Unable to fetch role: {{error}}",
189
+ unableToFetchMembers: "Unable to fetch members: {{error}}",
190
+ roleAction: "{{action}} role",
191
+ membersCount: "{{count}} members",
192
+ parentGroupCount: "{{count}} parent group",
193
+ childGroupsCount: "{{count}} child groups",
194
+ searchAndSelectUsersGroups: "Search and select users and groups to be added. Selected users and groups will appear in the table below.",
195
+ noUsersAndGroupsFound: "No users and groups found.",
196
+ errorFetchingUserGroups: "Error fetching user and groups: {{error}}",
197
+ nameRequired: "Name is required",
198
+ noMemberSelected: "No member selected",
199
+ noPluginSelected: "No plugin selected",
200
+ pluginRequired: "Plugin is required",
201
+ permissionRequired: "Permission is required",
202
+ editCell: "Edit...",
203
+ selectCell: "Select...",
204
+ expandRow: "expand row",
205
+ configureAccessFor: "Configure access for the",
206
+ defaultResourceTypeVisible: "By default, the selected resource type is visible to all added users. If you want to restrict or grant permission to specific plugin rules, select them and add the parameters."
207
+ }
208
+ };
209
+ const rbacTranslationRef = createTranslationRef({
210
+ id: "plugin.rbac",
211
+ messages: rbacMessages
212
+ });
213
+
214
+ export { rbacMessages, rbacTranslationRef };
215
+ //# sourceMappingURL=ref.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref.esm.js","sources":["../../src/translations/ref.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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport const rbacMessages = {\n page: {\n title: 'RBAC',\n createRole: 'Create role',\n editRole: 'Edit role',\n },\n table: {\n searchPlaceholder: 'Filter',\n labelRowsSelect: 'Rows',\n title: 'All roles',\n titleWithCount: 'All roles ({{count}})',\n headers: {\n name: 'Name',\n usersAndGroups: 'Users and groups',\n accessiblePlugins: 'Accessible plugins',\n actions: 'Actions',\n },\n emptyContent: 'No records found',\n },\n toolbar: {\n createButton: 'Create',\n warning: {\n title: 'Unable to create role.',\n message:\n 'To enable create/edit role button, make sure required users/groups are available in catalog as a role cannot be created without users/groups and also the role associated with your user should have the permission policies mentioned <link>here</link>.',\n linkText: 'here',\n note: 'Note',\n noteText:\n 'Even after ingesting users/groups in catalog and applying above permissions if the create/edit button is still disabled then please contact your administrator as you might be conditionally restricted from accessing the create/edit button.',\n },\n },\n errors: {\n notFound: 'Not Found',\n unauthorized: 'Unauthorized to create role',\n rbacDisabled: 'Enable the RBAC backend plugin to use this feature.',\n rbacDisabledInfo:\n 'To enable RBAC, set `permission.enabled` to `true` in the app-config file.',\n fetchRoles: 'Something went wrong while fetching the roles',\n fetchRole: 'Something went wrong while fetching the role',\n fetchPoliciesErr: 'Error fetching the policies. {{error}}',\n fetchPolicies:\n 'Something went wrong while fetching the permission policies',\n fetchPlugins: 'Error fetching the plugins. {{error}}',\n fetchConditionalPermissionPolicies:\n 'Error fetching the conditional permission policies. {{error}}',\n fetchConditions: 'Something went wrong while fetching the role conditions',\n fetchUsersAndGroups:\n 'Something went wrong while fetching the users and groups',\n createRole: 'Unable to create role.',\n editRole: 'Unable to edit the role.',\n deleteRole: 'Unable to delete the role.',\n roleCreatedSuccess:\n 'Role was created successfully but unable to add permission policies to the role.',\n roleCreatedConditionsSuccess:\n 'Role created successfully but unable to add conditions to the role.',\n },\n roleForm: {\n titles: {\n createRole: 'Create Role',\n editRole: 'Edit Role',\n nameAndDescription: 'Enter name and description of role',\n usersAndGroups: 'Add users and groups',\n permissionPolicies: 'Add permission policies',\n },\n review: {\n reviewAndCreate: 'Review and create',\n reviewAndSave: 'Review and save',\n nameDescriptionOwner: 'Name, description, and owner of role',\n },\n steps: {\n next: 'Next',\n back: 'Back',\n cancel: 'Cancel',\n reset: 'Reset',\n create: 'Create',\n update: 'Update',\n },\n fields: {\n name: {\n label: 'Name',\n helperText: 'Enter name of the role',\n },\n description: {\n label: 'Description',\n helperText:\n 'Enter a brief description about the role (The purpose of the role)',\n },\n owner: {\n label: 'Owner',\n helperText:\n 'Optional: Enter a user or group who will have permission to edit this role and create additional roles. In the next step, specify which users they can assign to their roles and which plugins they can grant access to. If left blank, automatically assigns the author at creation.',\n },\n },\n },\n deleteDialog: {\n title: 'Delete Role',\n question: 'Delete this role?',\n confirmation:\n 'Are you sure you want to delete the role **{{roleName}}**?\\n\\nDeleting this role is irreversible and will remove its functionality from the system. Proceed with caution.\\n\\nThe **{{members}}** associated with this role will lose access to all the **{{permissions}} permission policies** specified in this role.',\n roleNameLabel: 'Role name',\n roleNameHelper: 'Type the name of the role to confirm',\n deleteButton: 'Delete',\n cancelButton: 'Cancel',\n successMessage: 'Role {{roleName}} deleted successfully',\n },\n snackbar: {\n success: 'Success',\n },\n dialog: {\n cancelRoleCreation: 'Cancel role creation',\n exitRoleCreation: 'Exit role creation?',\n exitRoleEditing: 'Exit role editing?',\n exitWarning:\n '\\n\\nExiting this page will permanently discard the information you entered.\\n\\nAre you sure you want to exit?',\n discard: 'Discard',\n cancel: 'Cancel',\n },\n conditionalAccess: {\n condition: 'Condition',\n allOf: 'AllOf',\n anyOf: 'AnyOf',\n not: 'Not',\n addNestedCondition: 'Add nested condition',\n addRule: 'Add rule',\n nestedConditionTooltip:\n 'Nested conditions are **1 layer rules within a main condition**. It lets you allow appropriate access by using detailed permissions based on various conditions. You can add multiple nested conditions.',\n nestedConditionExample:\n 'For example, you can allow access to all entity types in the main condition and use a nested condition to limit the access to entities owned by the user.',\n },\n permissionPolicies: {\n helperText:\n 'By default, users are not granted access to any plugins. To grant user access, select the plugins you want to enable. Then, select which actions you would like to give user permission to.',\n allPlugins: 'All plugins ({{count}})',\n errorFetchingPolicies: 'Error fetching the permission policies: {{error}}',\n resourceTypeTooltip: 'resource type: {{resourceType}}',\n advancedPermissionsTooltip:\n 'Use advanced customized permissions to allow access to specific parts of the selected resource type.',\n pluginsSelected: '{{count}} plugins',\n noPluginsSelected: 'No plugins selected',\n search: 'Search',\n noRecordsToDisplay: 'No records to display.',\n selectedPluginsAppearHere: 'Selected plugins appear here.',\n selectPlugins: 'Select plugins',\n noPluginsFound: 'No plugins found.',\n plugin: 'Plugin',\n permission: 'Permission',\n policies: 'Policies',\n conditional: 'Conditional',\n rules: 'rules',\n rule: 'rule',\n permissionPolicies: 'Permission Policies',\n permissions: 'permissions',\n },\n common: {\n noResults: 'No results for this date range.',\n exportCSV: 'Export CSV',\n csvFilename: 'data-export.csv',\n noMembers: 'No members',\n groups: 'groups',\n group: 'group',\n users: 'users',\n user: 'user',\n use: 'Use',\n refresh: 'Refresh',\n edit: 'Edit',\n unauthorizedToEdit: 'Unauthorized to edit',\n noRecordsFound: 'No records found',\n selectUsersAndGroups: 'Select users and groups',\n clearSearch: 'clear search',\n closeDrawer: 'Close the drawer',\n remove: 'Remove',\n addRule: 'Add rule',\n selectRule: 'Select a rule',\n rule: 'Rule',\n removeNestedCondition: 'Remove nested condition',\n overview: 'Overview',\n about: 'About',\n description: 'Description',\n modifiedBy: 'Modified By',\n lastModified: 'Last Modified',\n owner: 'Owner',\n noUsersAndGroupsSelected: 'No users and groups selected',\n selectedUsersAndGroupsAppearHere: 'Selected users and groups appear here.',\n name: 'Name',\n type: 'Type',\n members: 'Members',\n actions: 'Actions',\n removeMember: 'Remove member',\n delete: 'Delete',\n deleteRole: 'Delete Role',\n update: 'Update',\n editRole: 'Edit Role',\n checkingPermissions: 'Checking permissions…',\n unauthorizedTo: 'Unauthorized to {{action}}',\n performThisAction: 'perform this action',\n unableToCreatePermissionPolicies:\n 'Unable to create the permission policies.',\n unableToDeletePermissionPolicies:\n 'Unable to delete the permission policies.',\n unableToRemoveConditions: 'Unable to remove conditions from the role.',\n unableToUpdateConditions: 'Unable to update conditions.',\n unableToAddConditions: 'Unable to add conditions to the role.',\n roleActionSuccessfully: 'Role {{roleName}} {{action}} successfully',\n unableToFetchRole: 'Unable to fetch role: {{error}}',\n unableToFetchMembers: 'Unable to fetch members: {{error}}',\n roleAction: '{{action}} role',\n membersCount: '{{count}} members',\n parentGroupCount: '{{count}} parent group',\n childGroupsCount: '{{count}} child groups',\n searchAndSelectUsersGroups:\n 'Search and select users and groups to be added. Selected users and groups will appear in the table below.',\n noUsersAndGroupsFound: 'No users and groups found.',\n errorFetchingUserGroups: 'Error fetching user and groups: {{error}}',\n nameRequired: 'Name is required',\n noMemberSelected: 'No member selected',\n noPluginSelected: 'No plugin selected',\n pluginRequired: 'Plugin is required',\n permissionRequired: 'Permission is required',\n editCell: 'Edit...',\n selectCell: 'Select...',\n expandRow: 'expand row',\n configureAccessFor: 'Configure access for the',\n defaultResourceTypeVisible:\n 'By default, the selected resource type is visible to all added users. If you want to restrict or grant permission to specific plugin rules, select them and add the parameters.',\n },\n};\n\n/**\n * Translation reference for RBAC plugin\n * @public\n */\nexport const rbacTranslationRef = createTranslationRef({\n id: 'plugin.rbac',\n messages: rbacMessages,\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,YAAe,GAAA;AAAA,EAC1B,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,UAAY,EAAA,aAAA;AAAA,IACZ,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,KAAO,EAAA;AAAA,IACL,iBAAmB,EAAA,QAAA;AAAA,IACnB,eAAiB,EAAA,MAAA;AAAA,IACjB,KAAO,EAAA,WAAA;AAAA,IACP,cAAgB,EAAA,uBAAA;AAAA,IAChB,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,MAAA;AAAA,MACN,cAAgB,EAAA,kBAAA;AAAA,MAChB,iBAAmB,EAAA,oBAAA;AAAA,MACnB,OAAS,EAAA;AAAA,KACX;AAAA,IACA,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,YAAc,EAAA,QAAA;AAAA,IACd,OAAS,EAAA;AAAA,MACP,KAAO,EAAA,wBAAA;AAAA,MACP,OACE,EAAA,2PAAA;AAAA,MACF,QAAU,EAAA,MAAA;AAAA,MACV,IAAM,EAAA,MAAA;AAAA,MACN,QACE,EAAA;AAAA;AACJ,GACF;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,QAAU,EAAA,WAAA;AAAA,IACV,YAAc,EAAA,6BAAA;AAAA,IACd,YAAc,EAAA,qDAAA;AAAA,IACd,gBACE,EAAA,4EAAA;AAAA,IACF,UAAY,EAAA,+CAAA;AAAA,IACZ,SAAW,EAAA,8CAAA;AAAA,IACX,gBAAkB,EAAA,wCAAA;AAAA,IAClB,aACE,EAAA,6DAAA;AAAA,IACF,YAAc,EAAA,uCAAA;AAAA,IACd,kCACE,EAAA,+DAAA;AAAA,IACF,eAAiB,EAAA,yDAAA;AAAA,IACjB,mBACE,EAAA,0DAAA;AAAA,IACF,UAAY,EAAA,wBAAA;AAAA,IACZ,QAAU,EAAA,0BAA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CACE,EAAA,2CAAA;AAAA,IACF,wBAA0B,EAAA,4CAAA;AAAA,IAC1B,wBAA0B,EAAA,8BAAA;AAAA,IAC1B,qBAAuB,EAAA,uCAAA;AAAA,IACvB,sBAAwB,EAAA,2CAAA;AAAA,IACxB,iBAAmB,EAAA,iCAAA;AAAA,IACnB,oBAAsB,EAAA,oCAAA;AAAA,IACtB,UAAY,EAAA,iBAAA;AAAA,IACZ,YAAc,EAAA,mBAAA;AAAA,IACd,gBAAkB,EAAA,wBAAA;AAAA,IAClB,gBAAkB,EAAA,wBAAA;AAAA,IAClB,0BACE,EAAA,2GAAA;AAAA,IACF,qBAAuB,EAAA,4BAAA;AAAA,IACvB,uBAAyB,EAAA,2CAAA;AAAA,IACzB,YAAc,EAAA,kBAAA;AAAA,IACd,gBAAkB,EAAA,oBAAA;AAAA,IAClB,gBAAkB,EAAA,oBAAA;AAAA,IAClB,cAAgB,EAAA,oBAAA;AAAA,IAChB,kBAAoB,EAAA,wBAAA;AAAA,IACpB,QAAU,EAAA,SAAA;AAAA,IACV,UAAY,EAAA,WAAA;AAAA,IACZ,SAAW,EAAA,YAAA;AAAA,IACX,kBAAoB,EAAA,0BAAA;AAAA,IACpB,0BACE,EAAA;AAAA;AAEN;AAMO,MAAM,qBAAqB,oBAAqB,CAAA;AAAA,EACrD,EAAI,EAAA,aAAA;AAAA,EACJ,QAAU,EAAA;AACZ,CAAC;;;;"}
@@ -1,12 +1,12 @@
1
- import { conditionButtons, criterias } from '../components/ConditionalAccess/const.esm.js';
1
+ import { criterias, getConditionButtons } from '../components/ConditionalAccess/const.esm.js';
2
2
  import { NotConditionType } from '../components/ConditionalAccess/types.esm.js';
3
3
 
4
4
  const ruleOptionDisabled = (ruleOption, conditions) => {
5
5
  return !!(conditions || []).find((con) => con.rule === ruleOption);
6
6
  };
7
- const nestedConditionButtons = conditionButtons.filter(
8
- (button) => button.val !== "condition"
9
- );
7
+ const nestedConditionButtons = (t) => {
8
+ return getConditionButtons(t).filter((button) => button.val !== "condition");
9
+ };
10
10
  const extractNestedConditions = (conditions, criteriaTypes, nestedConditions) => {
11
11
  conditions.forEach((c) => {
12
12
  criteriaTypes.forEach((ct) => {
@@ -1 +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 { 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 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 = (con: Condition): boolean => 'rule' in con;\n"],"names":[],"mappings":";;;AAgCa,MAAA,kBAAA,GAAqB,CAChC,UAAA,EACA,UACG,KAAA;AACH,EAAO,OAAA,CAAC,EAAE,UAAc,IAAA,IAAI,IAAK,CAAA,CAAA,GAAA,KAAO,GAAI,CAAA,IAAA,KAAS,UAAU,CAAA;AACjE;AAEO,MAAM,yBAAyB,gBAAiB,CAAA,MAAA;AAAA,EACrD,CAAA,MAAA,KAAU,OAAO,GAAQ,KAAA;AAC3B;AAEO,MAAM,uBAA0B,GAAA,CACrC,UACA,EAAA,aAAA,EACA,gBACG,KAAA;AACH,EAAA,UAAA,CAAW,QAAQ,CAAK,CAAA,KAAA;AACtB,IAAA,aAAA,CAAc,QAAQ,CAAM,EAAA,KAAA;AAC1B,MAAA,IAAI,OAAO,IAAK,CAAA,CAAC,CAAE,CAAA,QAAA,CAAS,EAAE,CAAG,EAAA;AAC/B,QAAA,gBAAA,CAAiB,KAAK,CAAC,CAAA;AAAA;AACzB,KACD,CAAA;AAAA,GACF,CAAA;AACH;AAEa,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C,MAAA,EACA,QACY,KAAA;AACZ,EAAI,IAAA,CAAC,QAAe,OAAA,KAAA;AACpB,EAAA,OAAA,CACI,MAAO,CAAA,QAAwC,CAAgB,IAAA,EAAA,EAC9D,MAAS,GAAA,CAAA;AAEhB;AAEO,MAAM,kBAAqB,GAAA,CAChC,MACA,EAAA,UAAA,EACA,QACY,KAAA;AACZ,EAAI,IAAA,CAAC,QAAe,OAAA,KAAA;AACpB,EAAA,MAAM,iBAAiB,MAAO,CAAA,IAAA,CAAK,WAAW,QAAQ,CAAE,EAAE,CAAC,CAAA;AAC3D,EAAA,MAAM,YACJ,GAAA,MAAA,CACE,SAAU,CAAA,GACZ,EACA,cAAc,CAAA;AAEhB,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,YAAY,CAAG,EAAA;AAC/B,IAAA,OAAO,YAAa,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA,CAAA,CAAE,SAAS,CAAC,CAAA;AAAA;AAE5C,EAAA,OAAO,cAAc,MAAS,GAAA,CAAA;AAChC;AAEa,MAAA,YAAA,GAAe,CAAC,GAAA,KAA4B,MAAU,IAAA;;;;"}
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 { RJSFValidationError } from '@rjsf/utils';\n\nimport {\n getConditionButtons,\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';\nimport { rbacTranslationRef } from '../translations';\nimport { TranslationFunction } from '@backstage/core-plugin-api/alpha';\n\nexport const ruleOptionDisabled = (\n ruleOption: string,\n conditions?: PermissionCondition[],\n) => {\n return !!(conditions || []).find(con => con.rule === ruleOption);\n};\n\nexport const nestedConditionButtons = (\n t: TranslationFunction<typeof rbacTranslationRef.T>,\n) => {\n return getConditionButtons(t).filter(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 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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;AAC/B,IAAA,OAAO,YAAa,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA,CAAA,CAAE,SAAS,CAAC,CAAA;AAAA;AAE5C,EAAA,OAAO,cAAc,MAAS,GAAA,CAAA;AAChC;AAEa,MAAA,YAAA,GAAe,CAAC,GAAA,KAA4B,MAAU,IAAA;;;;"}
@@ -20,14 +20,14 @@ const getRoleData = (values) => {
20
20
  }
21
21
  };
22
22
  };
23
- const validationSchema = yup.object({
24
- name: yup.string().required("Name is required"),
25
- selectedMembers: yup.array().min(1, "No member selected"),
26
- selectedPlugins: yup.array().min(1, "No plugin selected"),
23
+ const getValidationSchema = (t) => yup.object({
24
+ name: yup.string().required(t("common.nameRequired")),
25
+ selectedMembers: yup.array().min(1, t("common.noMemberSelected")),
26
+ selectedPlugins: yup.array().min(1, t("common.noPluginSelected")),
27
27
  permissionPoliciesRows: yup.array().of(
28
28
  yup.object().shape({
29
- plugin: yup.string().required("Plugin is required"),
30
- permission: yup.string().required("Permission is required"),
29
+ plugin: yup.string().required(t("common.pluginRequired")),
30
+ permission: yup.string().required(t("common.permissionRequired")),
31
31
  policies: yup.array().min(1).of(
32
32
  yup.object().shape({ policy: yup.string(), effect: yup.string() }).test((p) => p.effect === "allow")
33
33
  )
@@ -115,7 +115,7 @@ const getPluginsPermissionPoliciesData = (pluginsPermissionPolicies) => {
115
115
  );
116
116
  return { plugins, pluginsPermissions };
117
117
  };
118
- const getPermissionPoliciesData = (values) => {
118
+ const getPermissionPoliciesData = (values, locale = "en-US") => {
119
119
  const { kind, name, namespace, permissionPoliciesRows } = values;
120
120
  return permissionPoliciesRows.reduce(
121
121
  (acc, permissionPolicyRow) => {
@@ -134,7 +134,7 @@ const getPermissionPoliciesData = (values) => {
134
134
  {
135
135
  entityReference: `${kind}:${namespace}/${name}`,
136
136
  permission: resourceType && usingResourceType ? `${resourceType}` : `${permission}`,
137
- policy: policy.policy.toLocaleLowerCase("en-US"),
137
+ policy: policy.policy.toLocaleLowerCase(locale),
138
138
  effect: "allow"
139
139
  }
140
140
  ];
@@ -148,14 +148,14 @@ const getPermissionPoliciesData = (values) => {
148
148
  []
149
149
  );
150
150
  };
151
- const getConditionalPermissionPoliciesData = (values) => {
151
+ const getConditionalPermissionPoliciesData = (values, locale = "en-US") => {
152
152
  const { kind, name, namespace, permissionPoliciesRows } = values;
153
153
  return permissionPoliciesRows.reduce(
154
154
  (acc, permissionPolicyRow) => {
155
155
  const { policies, isResourced, plugin, conditions, resourceType } = permissionPolicyRow;
156
156
  const permissionMapping = policies.reduce((pAcc, policy) => {
157
157
  if (policy.effect === "allow") {
158
- return [...pAcc, policy.policy.toLocaleLowerCase("en-US")];
158
+ return [...pAcc, policy.policy.toLocaleLowerCase(locale)];
159
159
  }
160
160
  return pAcc;
161
161
  }, []);
@@ -242,5 +242,5 @@ const getRulesNumber = (conditions) => {
242
242
  return rulesNumber;
243
243
  };
244
244
 
245
- export { getChildGroupsCount, getConditionalPermissionPoliciesData, getMembersCount, getNewConditionalPolicies, getParentGroupsCount, getPermissionPolicies, getPermissionPoliciesData, getPermissionsNumber, getPluginsPermissionPoliciesData, getRemovedConditionalPoliciesIds, getRoleData, getRulesNumber, getUpdatedConditionalPolicies, uniqBy, validationSchema };
245
+ export { getChildGroupsCount, getConditionalPermissionPoliciesData, getMembersCount, getNewConditionalPolicies, getParentGroupsCount, getPermissionPolicies, getPermissionPoliciesData, getPermissionsNumber, getPluginsPermissionPoliciesData, getRemovedConditionalPoliciesIds, getRoleData, getRulesNumber, getUpdatedConditionalPolicies, getValidationSchema, uniqBy };
246
246
  //# sourceMappingURL=create-role-utils.esm.js.map