From d92235e515a7140c9828b12c47da0eb531ff49bc Mon Sep 17 00:00:00 2001 From: Fabrice Gangler <fabrice.gangler@adullact.org> Date: Thu, 27 Mar 2025 19:47:49 +0100 Subject: [PATCH] feat(organization): onmly connected user can add / edit --- .../webapp_routes/webapp_routes_prod.json | 8 ++++---- .../webapp_routes/webapp_routes_prod.md | 8 ++++---- .../webapp_routes/webapp_routes_prod.txt | 4 ++-- webapp/config/packages/security.yaml | 2 ++ .../Organization/OrganizationManageController.php | 4 ++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.json b/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.json index 643606f..685ac50 100644 --- a/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.json +++ b/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.json @@ -888,8 +888,8 @@ } }, "app_connected_user_add_organization.en": { - "path": "\/{_locale}\/organization\/add", - "pathRegex": "{^\/en\/organization\/add$}sDu", + "path": "\/{_locale}\/organizations\/add", + "pathRegex": "{^\/en\/organizations\/add$}sDu", "host": "ANY", "hostRegex": "", "scheme": "ANY", @@ -907,8 +907,8 @@ } }, "app_connected_user_add_organization.fr": { - "path": "\/{_locale}\/organisation\/add", - "pathRegex": "{^\/fr\/organisation\/add$}sDu", + "path": "\/{_locale}\/organisations\/add", + "pathRegex": "{^\/fr\/organisations\/add$}sDu", "host": "ANY", "hostRegex": "", "scheme": "ANY", diff --git a/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.md b/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.md index 9317e69..1a0c501 100644 --- a/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.md +++ b/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.md @@ -935,8 +935,8 @@ app_anonymous_organization_display_all_org_no_profit.fr app_connected_user_add_organization.en -------------------------------------- -- Path: /{_locale}/organization/add -- Path Regex: {^/en/organization/add$}sDu +- Path: /{_locale}/organizations/add +- Path Regex: {^/en/organizations/add$}sDu - Host: ANY - Host Regex: - Scheme: ANY @@ -955,8 +955,8 @@ app_connected_user_add_organization.en app_connected_user_add_organization.fr -------------------------------------- -- Path: /{_locale}/organisation/add -- Path Regex: {^/fr/organisation/add$}sDu +- Path: /{_locale}/organisations/add +- Path Regex: {^/fr/organisations/add$}sDu - Host: ANY - Host Regex: - Scheme: ANY diff --git a/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.txt b/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.txt index 26a9df9..c0a8c83 100644 --- a/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.txt +++ b/documentation/auto-generated-documentation/webapp_routes/webapp_routes_prod.txt @@ -49,8 +49,8 @@ app_anonymous_organization_display_all_no_profit_allow_to_change_locale_in_url.fr GET|HEAD ANY ANY /{_locale}/organizations/non-profit/ App\Controller\Organization\OrganizationDisplayController::allNoProfitOrgPageAllowToChangeLocaleInUrl() app_anonymous_organization_display_all_org_no_profit.en GET|HEAD ANY ANY /{_locale}/organizations/non-profit/ App\Controller\Organization\OrganizationDisplayController::displayAllNoProfitOrg() app_anonymous_organization_display_all_org_no_profit.fr GET|HEAD ANY ANY /{_locale}/organisations/association/ App\Controller\Organization\OrganizationDisplayController::displayAllNoProfitOrg() - app_connected_user_add_organization.en GET|POST ANY ANY /{_locale}/organization/add App\Controller\Organization\OrganizationManageController::createNewOrganization() - app_connected_user_add_organization.fr GET|POST ANY ANY /{_locale}/organisation/add App\Controller\Organization\OrganizationManageController::createNewOrganization() + app_connected_user_add_organization.en GET|POST ANY ANY /{_locale}/organizations/add App\Controller\Organization\OrganizationManageController::createNewOrganization() + app_connected_user_add_organization.fr GET|POST ANY ANY /{_locale}/organisations/add App\Controller\Organization\OrganizationManageController::createNewOrganization() app_connected_user_update_organization.en GET|POST ANY ANY /{_locale}/organization/{id}/{slug}/edit App\Controller\Organization\OrganizationManageController::updateOrganization() app_connected_user_update_organization.fr GET|POST ANY ANY /{_locale}/organisation/{id}/{slug}/edit App\Controller\Organization\OrganizationManageController::updateOrganization() app_sysamdin_migration_index GET ANY ANY /sysamdin/migration/ App\Controller\RecupOldDataController::index() diff --git a/webapp/config/packages/security.yaml b/webapp/config/packages/security.yaml index ef225b8..69e7df7 100644 --- a/webapp/config/packages/security.yaml +++ b/webapp/config/packages/security.yaml @@ -59,6 +59,8 @@ security: # - { path: ^/admin/configuration/, roles: ROLE_SUPERADMIN } - { path: ^/admin/configuration/, roles: ROLE_ADMIN } - { path: ^/admin/, roles: ROLE_ADMIN } + - { route: 'app_connected_user_add_organization', roles: ROLE_USER } + - { route: 'app_connected_user_update_organization', roles: ROLE_USER } - { path: ^/(en|fr)/user/account, roles: ROLE_USER } - { path: ^/(en|fr)/account/login, roles: PUBLIC_ACCESS } - { path: ^/(en|fr)/account/logout, roles: PUBLIC_ACCESS } diff --git a/webapp/src/Controller/Organization/OrganizationManageController.php b/webapp/src/Controller/Organization/OrganizationManageController.php index 54cbac8..42dedd1 100644 --- a/webapp/src/Controller/Organization/OrganizationManageController.php +++ b/webapp/src/Controller/Organization/OrganizationManageController.php @@ -49,8 +49,8 @@ class OrganizationManageController extends AbstractController { #[Route( path: [ - 'en' => '/{_locale}/organizations/new', - 'fr' => '/{_locale}/organisations/new', + 'en' => '/{_locale}/organizations/add', + 'fr' => '/{_locale}/organisations/add', ], name: 'app_connected_user_add_organization', methods: ['GET', 'POST'] -- GitLab