From b2950a8209904f10f1174843eaa3d05fdea8005d Mon Sep 17 00:00:00 2001 From: Etienne Gutbub Date: Tue, 23 Jan 2024 15:19:24 +0100 Subject: [PATCH] feat(Permissions): Allow permission RBAC for sylius plus on routes --- src/Resources/config/routes/admin.yaml | 16 ++++++++++++++++ src/Resources/translations/messages.en.yaml | 10 ++++++++++ src/Resources/translations/messages.fr.yaml | 10 ++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/Resources/config/routes/admin.yaml b/src/Resources/config/routes/admin.yaml index d6f4547b2..b4146837b 100644 --- a/src/Resources/config/routes/admin.yaml +++ b/src/Resources/config/routes/admin.yaml @@ -2,13 +2,29 @@ monsieurbiz_sylius_settings_admin_index: path: settings controller: MonsieurBiz\SyliusSettingsPlugin\Controller\SettingsController::indexAction methods: ['GET'] + defaults: + _sylius: + alias: monsieurbiz.settings_admin_index + section: admin + permission: true + monsieurbiz_sylius_settings_admin_edit: path: settings/edit/{alias} controller: MonsieurBiz\SyliusSettingsPlugin\Controller\SettingsController::formAction methods: ['GET'] + defaults: + _sylius: + alias: monsieurbiz.settings_admin_edit + section: admin + permission: true monsieurbiz_sylius_settings_admin_edit_post: path: settings/edit/{alias} controller: MonsieurBiz\SyliusSettingsPlugin\Controller\SettingsController::formAction methods: ['PUT'] + defaults: + _sylius: + alias: monsieurbiz.settings_admin_edit_post + section: admin + permission: true diff --git a/src/Resources/translations/messages.en.yaml b/src/Resources/translations/messages.en.yaml index 44ceacc7d..6587bb10d 100644 --- a/src/Resources/translations/messages.en.yaml +++ b/src/Resources/translations/messages.en.yaml @@ -18,3 +18,13 @@ monsieurbiz: title: sylius_default_values: Sylius' default values channel_default_values: Default values for %channelName% +sylius_plus: + rbac: + parent: + monsieurbiz: + settings_admin_edit_posts: 'Save settings' + settings_admin_edits: 'Edit settings' + settings_admin_indices: 'Settings list' + monsieurbiz_sylius_settings_admin_edit_post: 'Save' + monsieurbiz_sylius_settings_admin_edit: 'Update' + monsieurbiz_sylius_settings_admin_index: 'Index' diff --git a/src/Resources/translations/messages.fr.yaml b/src/Resources/translations/messages.fr.yaml index 390e5ff35..492e2e8e1 100644 --- a/src/Resources/translations/messages.fr.yaml +++ b/src/Resources/translations/messages.fr.yaml @@ -18,3 +18,13 @@ monsieurbiz: title: sylius_default_values: Valeurs par défaut de Sylius channel_default_values: Valeurs par défaut de %channelName% +sylius_plus: + rbac: + parent: + monsieurbiz: + settings_admin_edit_posts: 'Sauvegarde réglages' + settings_admin_edits: 'Éditer réglages' + settings_admin_indices: 'Lister réglages' + monsieurbiz_sylius_settings_admin_edit_post: 'Sauvegarde' + monsieurbiz_sylius_settings_admin_edit: 'Update' + monsieurbiz_sylius_settings_admin_index: 'Index'