From 7a7ae5b76fe423e29fd9fa200a15635f911f10b4 Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Thu, 30 Mar 2023 12:29:54 +0200 Subject: [PATCH 01/27] feat: folders permissions --- resources/js/app/app.js | 2 + .../app/components/permission/permission.vue | 42 +++++++++++++++ .../components/permissions/permissions.vue | 51 +++++++++++++++++++ .../components/property-view/property-view.js | 2 + .../js/app/components/tree-view/tree-view.js | 29 ++++++++++- templates/Element/Form/permissions.twig | 16 ++++++ templates/Element/Form/trees.twig | 3 +- templates/Pages/Modules/index.twig | 2 +- templates/Pages/Modules/view.twig | 4 ++ 9 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 resources/js/app/components/permission/permission.vue create mode 100644 resources/js/app/components/permissions/permissions.vue create mode 100644 templates/Element/Form/permissions.twig diff --git a/resources/js/app/app.js b/resources/js/app/app.js index a382cb8fa..c062a4a51 100644 --- a/resources/js/app/app.js +++ b/resources/js/app/app.js @@ -68,6 +68,8 @@ const _vueInstance = new Vue({ KeyValueList: () => import(/* webpackChunkName: "key-value-list" */'app/components/json-fields/key-value-list'), StringList: () => import(/* webpackChunkName: "string-list" */'app/components/json-fields/string-list'), Thumbnail:() => import(/* webpackChunkName: "thumbnail" */'app/components/thumbnail/thumbnail'), + Permission:() => import(/* webpackChunkName: "permission" */'app/components/permission/permission'), + Permissions:() => import(/* webpackChunkName: "permissions" */'app/components/permissions/permissions'), Icon, }, diff --git a/resources/js/app/components/permission/permission.vue b/resources/js/app/components/permission/permission.vue new file mode 100644 index 000000000..9f07fb0e0 --- /dev/null +++ b/resources/js/app/components/permission/permission.vue @@ -0,0 +1,42 @@ + + + diff --git a/resources/js/app/components/permissions/permissions.vue b/resources/js/app/components/permissions/permissions.vue new file mode 100644 index 000000000..21f95daba --- /dev/null +++ b/resources/js/app/components/permissions/permissions.vue @@ -0,0 +1,51 @@ + + + diff --git a/resources/js/app/components/property-view/property-view.js b/resources/js/app/components/property-view/property-view.js index 04d0bc6f2..05a1d2503 100644 --- a/resources/js/app/components/property-view/property-view.js +++ b/resources/js/app/components/property-view/property-view.js @@ -39,6 +39,8 @@ export default { ObjectProperties: () => import(/* webpackChunkName: "string-list" */'app/components/object-property/object-properties'), ObjectPropertyAdd: () => import(/* webpackChunkName: "object-property-add" */'app/components/object-property/object-property-add'), Thumbnail:() => import(/* webpackChunkName: "thumbnail" */'app/components/thumbnail/thumbnail'), + Permission:() => import(/* webpackChunkName: "permission" */'app/components/permission/permission'), + Permissions:() => import(/* webpackChunkName: "permissions" */'app/components/permissions/permissions'), Icon, }, diff --git a/resources/js/app/components/tree-view/tree-view.js b/resources/js/app/components/tree-view/tree-view.js index ef870f5ea..2477b20cc 100644 --- a/resources/js/app/components/tree-view/tree-view.js +++ b/resources/js/app/components/tree-view/tree-view.js @@ -14,6 +14,7 @@ * @property {Array} parents The list of current item parents. */ +import { Icon } from '@iconify/vue2'; import { t } from 'ttag'; const API_URL = new URL(BEDITA.base).pathname; @@ -57,6 +58,10 @@ export default { /> <: node.attributes.title :> + + + + - ${t`edit`} + ${t('view')} + ${t('edit')}
`, + components: { + Icon, + }, + props: { store: { type: Object, @@ -142,6 +153,7 @@ export default { type: Boolean, default: true, }, + userRoles: Array, }, data() { @@ -197,6 +209,21 @@ export default { return !!this.node.meta?.relation?.canonical; }, + hasPermissions() { + const roles = this.node?.meta?.perms?.roles || []; + + return roles.length > 0 + }, + + isLocked() { + if (this.userRoles.includes('admin')) { + return false; + } + const roles = this.node?.meta?.perms?.roles || []; + + return !roles.some(item => this.userRoles.includes(item)) + }, + /** * The folders link. * diff --git a/templates/Element/Form/permissions.twig b/templates/Element/Form/permissions.twig new file mode 100644 index 000000000..2ad8cc569 --- /dev/null +++ b/templates/Element/Form/permissions.twig @@ -0,0 +1,16 @@ + +
+
+

{{ __('Permissions') }}

+
+ +
+ + +
+
+
diff --git a/templates/Element/Form/trees.twig b/templates/Element/Form/trees.twig index 77730d370..d081c36bc 100644 --- a/templates/Element/Form/trees.twig +++ b/templates/Element/Form/trees.twig @@ -22,7 +22,8 @@ relation-name={{ relationName }} relation-label="{{ Layout.tr(relationName) }}" :object='{{ { id: object.id, type: object.type }|json_encode }}' - :multiple-choice={{ options.multiple }}> + :multiple-choice={{ options.multiple }} + :user-roles="{{ user.roles|json_encode}}"> {% do Form.unlockField('relations.' ~ relationName ~ '.replaceRelated') %} {{ Form.hidden('_changedParents', {'value': '0', 'id': 'changedParents'})|raw }} diff --git a/templates/Pages/Modules/index.twig b/templates/Pages/Modules/index.twig index 3c9515a83..177881cad 100644 --- a/templates/Pages/Modules/index.twig +++ b/templates/Pages/Modules/index.twig @@ -9,7 +9,7 @@
{% if treeView %} - + {% else %}
diff --git a/templates/Pages/Modules/view.twig b/templates/Pages/Modules/view.twig index b8e8ba3b2..806e5a509 100644 --- a/templates/Pages/Modules/view.twig +++ b/templates/Pages/Modules/view.twig @@ -43,6 +43,10 @@ {{ element('Form/core_properties') }} + {% if objectType == 'folders' %} + {{ element('Form/permissions') }} + {% endif %} + {{ element('Form/custom_left') }} {# calendar using `date_ranges` #} From a75ccf95669a0f4913c5a38a306065bb447e1db3 Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Thu, 30 Mar 2023 13:32:05 +0200 Subject: [PATCH 02/27] feat: PermsHelper handle folder perms --- src/View/Helper/PermsHelper.php | 56 ++++++++++++++-- .../TestCase/View/Helper/PermsHelperTest.php | 67 +++++++++++++++++++ 2 files changed, 116 insertions(+), 7 deletions(-) diff --git a/src/View/Helper/PermsHelper.php b/src/View/Helper/PermsHelper.php index 2fa62472a..bacad3c1d 100644 --- a/src/View/Helper/PermsHelper.php +++ b/src/View/Helper/PermsHelper.php @@ -62,10 +62,7 @@ public function initialize(array $config): void */ public function canLock(): bool { - /** @var \Authentication\Identity $identity */ - $identity = $this->_View->get('user'); - - return in_array('admin', (array)$identity->get('roles')); + return $this->userIsAdmin(); } /** @@ -76,7 +73,7 @@ public function canLock(): bool */ public function canCreate(?string $module = null): bool { - return $this->isAllowed('POST', $module); + return $this->isAllowed('POST', $module) && $this->userIsAllowed($module); } /** @@ -90,7 +87,7 @@ public function canDelete(array $object): bool $locked = (bool)Hash::get($object, 'meta.locked', false); $module = (string)Hash::get($object, 'type'); - return !$locked && $this->isAllowed('DELETE', $module); + return !$locked && $this->isAllowed('DELETE', $module) && $this->userIsAllowed($module); } /** @@ -101,7 +98,7 @@ public function canDelete(array $object): bool */ public function canSave(?string $module = null): bool { - return $this->isAllowed('PATCH', $module); + return $this->isAllowed('PATCH', $module) && $this->userIsAllowed($module); } /** @@ -159,4 +156,49 @@ public function access(array $accessControl, string $roleName, string $moduleNam return in_array($moduleName, $readonlyModules) ? 'read' : 'write'; } + + /** + * Return true if authenticated user has role admin + * + * @return bool + */ + public function userIsAdmin(): bool + { + return in_array('admin', $this->userRoles()); + } + + /** + * Check permissions for user if object is a folder. + * + * @param string|null $module The module, if passed. + * @return bool + */ + public function userIsAllowed(?string $module): bool + { + $objectType = !empty($module) ? $module : $this->_View->get('objectType'); + if ($objectType !== 'folders' || $this->userIsAdmin()) { + return true; + } + + $object = $this->_View->get('object'); + $permsRoles = (array)Hash::get((array)$object, 'meta.perms.roles'); + if (empty($permsRoles)) { + return true; + } + + return !empty(array_intersect($permsRoles, (array)$this->userRoles())); + } + + /** + * Return authenticated user roles + * + * @return array + */ + public function userRoles(): array + { + /** @var \Authentication\Identity $identity */ + $identity = $this->_View->get('user'); + + return (array)$identity->get('roles'); + } } diff --git a/tests/TestCase/View/Helper/PermsHelperTest.php b/tests/TestCase/View/Helper/PermsHelperTest.php index d10ee2d31..233d9e51d 100644 --- a/tests/TestCase/View/Helper/PermsHelperTest.php +++ b/tests/TestCase/View/Helper/PermsHelperTest.php @@ -244,4 +244,71 @@ public function testAccess(array $accessControl, string $roleName, string $modul $actual = $this->Perms->access($accessControl, $roleName, $moduleName); static::assertSame($expected, $actual); } + + /** + * Test `userIsAdmin` + * + * @return void + * @covers ::userIsAdmin() + */ + public function testUserIsAdmin(): void + { + $this->Perms->getView()->set('user', new Identity([])); + $actual = $this->Perms->userIsAdmin(); + static::assertFalse($actual); + + $this->Perms->getView()->set('user', new Identity(['roles' => ['admin']])); + $actual = $this->Perms->userIsAdmin(); + static::assertTrue($actual); + } + + /** + * Test `userIsAllowed + * + * @return void + * @covers ::userIsAllowed() + */ + public function testUserIsAllowed(): void + { + // not folders + $this->Perms->getView()->set('objectType', 'documents'); + $actual = $this->Perms->userIsAllowed(null); + static::assertTrue($actual); + + // user admin + $this->Perms->getView()->set('objectType', 'folders'); + $this->Perms->getView()->set('user', new Identity(['roles' => ['admin']])); + $actual = $this->Perms->userIsAllowed(null); + static::assertTrue($actual); + + // empty meta.perms.roles + $this->Perms->getView()->set('object', ['meta' => []]); + $this->Perms->getView()->set('user', new Identity(['roles' => ['guest', 'manager', 'other']])); + $actual = $this->Perms->userIsAllowed(null); + static::assertTrue($actual); + + // has permission + $this->Perms->getView()->set('object', ['meta' => ['perms' => ['roles' => ['a', 'b', 'manager', 'c', 'd']]]]); + $actual = $this->Perms->userIsAllowed(null); + static::assertTrue($actual); + + // no permission + $this->Perms->getView()->set('object', ['meta' => ['perms' => ['roles' => ['a', 'b', 'c', 'd']]]]); + $actual = $this->Perms->userIsAllowed(null); + static::assertFalse($actual); + } + + /** + * Test `userRoles` + * + * @return void + * @covers ::userRoles() + */ + public function testUserRoles(): void + { + $expected = ['a', 'b', 'c']; + $this->Perms->getView()->set('user', new Identity(['roles' => $expected])); + $actual = $this->Perms->userRoles(); + static::assertSame($expected, $actual); + } } From 955dc0fe314f636565eeb6ca6b2d10d8ac771a01 Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Thu, 30 Mar 2023 14:31:32 +0200 Subject: [PATCH 03/27] refactor: tree-view as vue file --- .../tree-view/{tree-view.js => tree-view.vue} | 175 +++++++----------- 1 file changed, 64 insertions(+), 111 deletions(-) rename resources/js/app/components/tree-view/{tree-view.js => tree-view.vue} (71%) diff --git a/resources/js/app/components/tree-view/tree-view.js b/resources/js/app/components/tree-view/tree-view.vue similarity index 71% rename from resources/js/app/components/tree-view/tree-view.js rename to resources/js/app/components/tree-view/tree-view.vue index 2477b20cc..333059cd1 100644 --- a/resources/js/app/components/tree-view/tree-view.js +++ b/resources/js/app/components/tree-view/tree-view.vue @@ -1,19 +1,65 @@ -/** - * Templates that uses this component (directly or indirectly): - * Template/Elements/trees.twig - * - * component used for ModulesPage -> View - * - * @property {Object} store The folders store. - * @property {string} parent The parent of the tree item. - * @property {Object} node The model of the tree item. - * @property {Object} object The current item to place in the tree. - * @property {string} relationName The name of the relation to save. - * @property {string} relationLabel The label of the relation to save. - * @property {boolean} multipleChoice Should handle multiple relations. - * @property {Array} parents The list of current item parents. - */ - + + From 400658f1f1b53e6f23a8a5f5d49184c67a97f92b Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Thu, 30 Mar 2023 14:34:26 +0200 Subject: [PATCH 04/27] fix: permission component --- resources/js/app/components/permission/permission.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/js/app/components/permission/permission.vue b/resources/js/app/components/permission/permission.vue index 9f07fb0e0..eb3141a9b 100644 --- a/resources/js/app/components/permission/permission.vue +++ b/resources/js/app/components/permission/permission.vue @@ -1,7 +1,7 @@ @@ -35,7 +35,7 @@ export default { return false; } - return this.userRoles.includes(this.role); + return !this.userRoles.includes(this.role); }, }, } From fce1cefde60af3cc78b173fa89edf73830f4123b Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Thu, 30 Mar 2023 14:37:03 +0200 Subject: [PATCH 05/27] fix: restore jsdoc in tree-view.vue --- .../js/app/components/tree-view/tree-view.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/resources/js/app/components/tree-view/tree-view.vue b/resources/js/app/components/tree-view/tree-view.vue index 333059cd1..485ad8158 100644 --- a/resources/js/app/components/tree-view/tree-view.vue +++ b/resources/js/app/components/tree-view/tree-view.vue @@ -60,6 +60,21 @@
From 0ffe9a62b9e02dbb259e5ef40768a1689f7eac28 Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Thu, 30 Mar 2023 18:26:24 +0200 Subject: [PATCH 06/27] feat: better permissions --- locales/default.pot | 71 +++++++------------ locales/en_US/default.po | 71 +++++++------------ locales/it_IT/default.po | 28 ++++---- .../app/components/permission/permission.vue | 6 +- .../components/permissions/permissions.vue | 12 +++- .../js/app/components/tree-view/tree-view.vue | 5 +- templates/Element/Form/permissions.twig | 2 +- 7 files changed, 82 insertions(+), 113 deletions(-) diff --git a/locales/default.pot b/locales/default.pot index b9127d174..81841ba9e 100644 --- a/locales/default.pot +++ b/locales/default.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: BEdita 4 \n" -"POT-Creation-Date: 2023-03-06 16:09:45 \n" +"POT-Creation-Date: 2023-03-30 16:22:13 \n" "MIME-Version: 1.0 \n" "Content-Transfer-Encoding: 8bit \n" "Language-Team: BEdita I18N & I10N Team \n" @@ -23,9 +23,6 @@ msgstr "" msgid "Add" msgstr "" -msgid "Add custom property" -msgstr "" - msgid "Add translation" msgstr "" @@ -263,9 +260,6 @@ msgstr "" msgid "Embed online content" msgstr "" -msgid "Empty request data" -msgstr "" - msgid "Empty translation \"id\"" msgstr "" @@ -512,15 +506,6 @@ msgstr "" msgid "No application" msgstr "" -msgid "No core properties" -msgstr "" - -msgid "No custom properties" -msgstr "" - -msgid "No inherited properties" -msgstr "" - msgid "No items found" msgstr "" @@ -617,6 +602,9 @@ msgstr "" msgid "Permanently delete" msgstr "" +msgid "Permissions" +msgstr "" + msgid "Person Title" msgstr "" @@ -1207,12 +1195,6 @@ msgstr "" msgid "Uri is not valid" msgstr "" -msgid "edit" -msgstr "" - -msgid "Menu" -msgstr "" - msgid "Search existing tags" msgstr "" @@ -1249,15 +1231,6 @@ msgstr "" msgid "Error while creating new object." msgstr "" -msgid "Inherited from" -msgstr "" - -msgid "Show" -msgstr "" - -msgid "Hide" -msgstr "" - msgid "Error on deleting property" msgstr "" @@ -1268,7 +1241,7 @@ msgstr "" #. * component used for ModulesPage -> View #. * #. * Handle Locations and reverse geocoding from addresses -#. +#. msgid "Title" msgstr "" @@ -1276,7 +1249,7 @@ msgstr "" #. * component used for ModulesPage -> View #. * #. * Handle Locations and reverse geocoding from addresses -#. +#. msgid "Address" msgstr "" @@ -1284,10 +1257,18 @@ msgstr "" #. * component used for ModulesPage -> View #. * #. * Handle Locations and reverse geocoding from addresses -#. +#. msgid "GET" msgstr "" +#. * +#. * component used for ModulesPage -> View +#. * +#. * Handle Locations and reverse geocoding from addresses +#. +msgid "edit" +msgstr "" + #. * #. * Templates that uses this component (directly or indirectly): #. * ... @@ -1295,7 +1276,7 @@ msgstr "" #. * component used for ModulesPage -> View #. * #. * Handle Locations and reverse geocoding from addresses -#. +#. msgid "add new" msgstr "" @@ -1310,7 +1291,7 @@ msgstr "" #. * #. * Component to fetch and display changes' history. -#. +#. msgid "No History data found" msgstr "" @@ -1331,7 +1312,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Every day" msgstr "" @@ -1340,7 +1321,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Sunday" msgstr "" @@ -1349,7 +1330,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Monday" msgstr "" @@ -1358,7 +1339,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Tuesday" msgstr "" @@ -1367,7 +1348,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Wednesday" msgstr "" @@ -1376,7 +1357,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Thursday" msgstr "" @@ -1385,7 +1366,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Friday" msgstr "" @@ -1394,7 +1375,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Saturday" msgstr "" @@ -1403,7 +1384,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Invalid date range" msgstr "" diff --git a/locales/en_US/default.po b/locales/en_US/default.po index 12174cef8..435a69718 100644 --- a/locales/en_US/default.po +++ b/locales/en_US/default.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: BEdita Manager \n" -"POT-Creation-Date: 2023-03-06 16:09:45 \n" +"POT-Creation-Date: 2023-03-30 16:04:57 \n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: BEdita I18N & I10N Team \n" @@ -26,9 +26,6 @@ msgstr "" msgid "Add" msgstr "" -msgid "Add custom property" -msgstr "" - msgid "Add translation" msgstr "" @@ -266,9 +263,6 @@ msgstr "" msgid "Embed online content" msgstr "" -msgid "Empty request data" -msgstr "" - msgid "Empty translation \"id\"" msgstr "" @@ -515,15 +509,6 @@ msgstr "" msgid "No application" msgstr "" -msgid "No core properties" -msgstr "" - -msgid "No custom properties" -msgstr "" - -msgid "No inherited properties" -msgstr "" - msgid "No items found" msgstr "" @@ -620,6 +605,9 @@ msgstr "" msgid "Permanently delete" msgstr "" +msgid "Permissions" +msgstr "" + msgid "Person Title" msgstr "" @@ -1210,12 +1198,6 @@ msgstr "" msgid "Uri is not valid" msgstr "" -msgid "edit" -msgstr "" - -msgid "Menu" -msgstr "" - msgid "Search existing tags" msgstr "" @@ -1252,15 +1234,6 @@ msgstr "" msgid "Error while creating new object." msgstr "" -msgid "Inherited from" -msgstr "" - -msgid "Show" -msgstr "" - -msgid "Hide" -msgstr "" - msgid "Error on deleting property" msgstr "" @@ -1271,7 +1244,7 @@ msgstr "" #. * component used for ModulesPage -> View #. * #. * Handle Locations and reverse geocoding from addresses -#. +#. msgid "Title" msgstr "" @@ -1279,7 +1252,7 @@ msgstr "" #. * component used for ModulesPage -> View #. * #. * Handle Locations and reverse geocoding from addresses -#. +#. msgid "Address" msgstr "" @@ -1287,10 +1260,18 @@ msgstr "" #. * component used for ModulesPage -> View #. * #. * Handle Locations and reverse geocoding from addresses -#. +#. msgid "GET" msgstr "" +#. * +#. * component used for ModulesPage -> View +#. * +#. * Handle Locations and reverse geocoding from addresses +#. +msgid "edit" +msgstr "" + #. * #. * Templates that uses this component (directly or indirectly): #. * ... @@ -1298,7 +1279,7 @@ msgstr "" #. * component used for ModulesPage -> View #. * #. * Handle Locations and reverse geocoding from addresses -#. +#. msgid "add new" msgstr "" @@ -1313,7 +1294,7 @@ msgstr "" #. * #. * Component to fetch and display changes' history. -#. +#. msgid "No History data found" msgstr "" @@ -1334,7 +1315,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Every day" msgstr "" @@ -1343,7 +1324,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Sunday" msgstr "" @@ -1352,7 +1333,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Monday" msgstr "" @@ -1361,7 +1342,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Tuesday" msgstr "" @@ -1370,7 +1351,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Wednesday" msgstr "" @@ -1379,7 +1360,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Thursday" msgstr "" @@ -1388,7 +1369,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Friday" msgstr "" @@ -1397,7 +1378,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Saturday" msgstr "" @@ -1406,7 +1387,7 @@ msgstr "" #. * Template/Elements/calendar.twig #. * #. * component used for ModulesPage -> View -#. +#. msgid "Invalid date range" msgstr "" diff --git a/locales/it_IT/default.po b/locales/it_IT/default.po index 1a8090d78..cf8c4d6f0 100644 --- a/locales/it_IT/default.po +++ b/locales/it_IT/default.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: BEdita Manager \n" -"POT-Creation-Date: 2023-03-06 16:09:45 \n" +"POT-Creation-Date: 2023-03-30 16:22:13 \n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: BEdita I18N & I10N Team \n" @@ -26,9 +26,6 @@ msgstr "Azioni sugli oggetti selezionati" msgid "Add" msgstr "Aggiungi" -msgid "Add custom property" -msgstr "Aggiungi proprietà custom" - msgid "Add translation" msgstr "Aggiungi traduzione" @@ -266,9 +263,6 @@ msgstr "E-mail" msgid "Embed online content" msgstr "Incorpora contenuti online" -msgid "Empty request data" -msgstr "Nessuno dato in request" - msgid "Empty translation \"id\"" msgstr "Identificatore traduzione vuoto (\"id\")" @@ -515,15 +509,6 @@ msgstr "No" msgid "No application" msgstr "Nessuna applicazione" -msgid "No core properties" -msgstr "Nessuna proprietà di base" - -msgid "No custom properties" -msgstr "Nessuna proprietà personalizzata" - -msgid "No inherited properties" -msgstr "Nessuna proprietà ereditata" - msgid "No items found" msgstr "Nessun elemento trovato" @@ -620,6 +605,9 @@ msgstr "Richiesta di reimpostazione password inviata" msgid "Permanently delete" msgstr "Elimina definitivamente" +msgid "Permissions" +msgstr "Permessi" + msgid "Person Title" msgstr "Titolo Persona" @@ -1297,6 +1285,14 @@ msgstr "Indirizzo" msgid "GET" msgstr "" +#. * +#. * component used for ModulesPage -> View +#. * +#. * Handle Locations and reverse geocoding from addresses +#. +msgid "edit" +msgstr "modifica" + #. * #. * Templates that uses this component (directly or indirectly): #. * ... diff --git a/resources/js/app/components/permission/permission.vue b/resources/js/app/components/permission/permission.vue index eb3141a9b..7e55c234f 100644 --- a/resources/js/app/components/permission/permission.vue +++ b/resources/js/app/components/permission/permission.vue @@ -2,6 +2,7 @@ + @@ -18,6 +19,7 @@ export default { }, props: { + inherited: false, objectRoles: [], role: '', userRoles: [], @@ -28,7 +30,9 @@ export default { return this.objectRoles.includes(this.role); }, help() { - return `${t('Your roles')}: ${this.userRoles.join(',')}`; + const inherit = this.inherited ? t('inherited') : ''; + + return `${t('Your roles')}: ${this.userRoles.join(',')} ${inherit}`; }, isLocked() { if (this.userRoles.includes('admin')) { diff --git a/resources/js/app/components/permissions/permissions.vue b/resources/js/app/components/permissions/permissions.vue index 21f95daba..55ab59c6e 100644 --- a/resources/js/app/components/permissions/permissions.vue +++ b/resources/js/app/components/permissions/permissions.vue @@ -1,9 +1,11 @@