From 239742e642f60f12a5150c9c63ffdb5aea5c355d Mon Sep 17 00:00:00 2001 From: Baptiste Leduc Date: Sat, 10 Oct 2026 09:06:44 +0000 Subject: [PATCH] =?UTF-8?q?S=C3=A9curise=20le=20back-office=20admin=20:=20?= =?UTF-8?q?matrice=20READ/WRITE=20par=20module=20et=20IsGranted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/packages/backoffice_menu.yaml | 109 +++---- config/packages/security.yaml | 61 ++-- db/seeds/Users.php | 13 +- phpstan.neon | 1 + sources/AppBundle/Association/Model/User.php | 7 +- .../Configuration/AddAccountAction.php | 2 + .../Configuration/AddCategoryAction.php | 2 + .../Configuration/AddEventAction.php | 2 + .../Configuration/AddOperationAction.php | 2 + .../Configuration/AddPaymentAction.php | 2 + .../Configuration/AddRuleAction.php | 2 + .../Configuration/ArchiveAccountAction.php | 2 + .../Configuration/EditAccountAction.php | 2 + .../Configuration/EditCategoryAction.php | 2 + .../Configuration/EditEventAction.php | 2 + .../Configuration/EditOperationAction.php | 2 + .../Configuration/EditPaymentAction.php | 2 + .../Configuration/EditRuleAction.php | 2 + .../Configuration/ListAccountAction.php | 2 + .../Configuration/ListCategoryAction.php | 2 + .../Configuration/ListEventAction.php | 2 + .../Configuration/ListOperationAction.php | 2 + .../Configuration/ListPaymentAction.php | 2 + .../Configuration/ListRuleAction.php | 2 + .../Configuration/RestoreAccountAction.php | 2 + .../Invoice/DownloadInvoiceAction.php | 2 + .../Accounting/Invoice/EditInvoiceAction.php | 2 + .../Accounting/Invoice/ListInvoiceAction.php | 2 + .../Invoice/MarkFactureAsSentAction.php | 2 + .../Invoice/SendInvoiceEmailAction.php | 2 + .../Journal/AddTransactionAction.php | 2 + .../Accounting/Journal/AllocateAction.php | 2 + .../Admin/Accounting/Journal/DeleteAction.php | 2 + .../Journal/DownloadAttachmentAction.php | 2 + .../Journal/DownloadAttachmentsAction.php | 2 + .../Journal/EditTransactionAction.php | 2 + .../Admin/Accounting/Journal/ExportAction.php | 2 + .../Admin/Accounting/Journal/ImportAction.php | 2 + .../Admin/Accounting/Journal/ListAction.php | 2 + .../Accounting/Journal/UpdateInfoAction.php | 2 + .../Journal/UploadAttachmentAction.php | 2 + .../MembershipFee/AddMembershipFeeAction.php | 2 + .../DeleteMembershipFeeAction.php | 2 + .../DownloadMembershipFeeInvoiceAction.php | 2 + .../MembershipFee/EditMembershipFeeAction.php | 2 + .../MembershipFee/ListMembershipFeeAction.php | 2 + .../SendMembershipFeeInvoiceAction.php | 2 + .../Accounting/Produit/AddProduitAction.php | 2 + .../Produit/DeleteProduitAction.php | 2 + .../Accounting/Produit/EditProduitAction.php | 2 + .../Accounting/Produit/ListProduitAction.php | 2 + .../Quotation/AddQuotationAction.php | 2 + .../Quotation/ConvertQuotationAction.php | 2 + .../Quotation/DownloadQuotationAction.php | 2 + .../Quotation/EditQuotationAction.php | 2 + .../Quotation/ListQuotationAction.php | 2 + .../Admin/Accounting/SearchAction.php | 2 + .../Admin/AdministratorsListAction.php | 2 + .../Admin/Antennes/AntenneListAction.php | 2 + .../Controller/Admin/Audit/IndexAction.php | 2 + .../Admin/Event/AddBilleteriePriveeAction.php | 2 + .../Controller/Admin/Event/ArchiveAction.php | 2 + .../Admin/Event/BadgesGenerateAction.php | 2 + .../Admin/Event/BilleteriePriveeAction.php | 2 + .../Event/DeleteBilleteriePriveeAction.php | 2 + .../Admin/Event/DeleteSponsorTicketAction.php | 2 + .../Event/EditBilleteriePriveeAction.php | 2 + .../Controller/Admin/Event/EventAction.php | 2 + .../Event/EventEditorializationAction.php | 2 + .../Admin/Event/EventThemeAction.php | 2 + .../Admin/Event/EventThemeAddEditAction.php | 2 + .../Admin/Event/ExtendSpecialPriceAction.php | 2 + .../Event/Facturation/DeleteFactureAction.php | 2 + .../Event/Facturation/DownloadDevisAction.php | 2 + .../Facturation/DownloadFactureAction.php | 2 + .../Event/Facturation/IssueFactureAction.php | 2 + .../Event/Facturation/ListFacturesAction.php | 2 + .../Event/Facturation/SendFactureAction.php | 2 + .../Admin/Event/Interview/AddOrEditAction.php | 2 + .../Admin/Event/Interview/ConfigAction.php | 2 + .../Admin/Event/Interview/ListAction.php | 2 + .../Controller/Admin/Event/ListAction.php | 2 + .../Admin/Event/PendingBankwiresAction.php | 2 + .../Event/PreviousRegistrationsAction.php | 2 + .../Controller/Admin/Event/PricesAction.php | 2 + .../Admin/Event/PricesAddAction.php | 2 + .../Admin/Event/PricesEditAction.php | 2 + .../Admin/Event/RemoveEventAction.php | 2 + .../Admin/Event/ResendSponsorTokenAction.php | 2 + .../Controller/Admin/Event/RestoreAction.php | 2 + .../Controller/Admin/Event/RoomAction.php | 2 + .../Event/SendLastCallSponsorTokenAction.php | 2 + .../Event/SendTestInscriptionEmailAction.php | 2 + .../Event/Session/CalendarAjaxAction.php | 2 + .../Admin/Event/Session/DeleteAction.php | 2 + .../Admin/Event/Session/EditAction.php | 2 + .../Admin/Event/Session/IndexAction.php | 2 + .../Admin/Event/SpeakerInfosAction.php | 2 + .../Admin/Event/SpeakersExpensesAction.php | 2 + .../Admin/Event/SpeakersManagementAction.php | 2 + .../Admin/Event/SpecialPriceAction.php | 2 + .../Admin/Event/SponsorTicketAction.php | 2 + .../Controller/Admin/Event/StatsAction.php | 2 + .../Admin/Event/Ticket/AddAction.php | 2 + .../Admin/Event/Ticket/DeleteAction.php | 2 + .../Admin/Event/Ticket/EditAction.php | 2 + .../Admin/Event/Ticket/IndexAction.php | 2 + .../Admin/Event/VotesListeAction.php | 2 + .../Controller/Admin/GetMenuAction.php | 2 + .../Admin/GithubUser/GithubUserAddAction.php | 2 + .../Admin/GithubUser/GithubUserListAction.php | 2 + .../Admin/HealthcheckController.php | 2 + .../AppBundle/Controller/Admin/HomeAction.php | 2 + .../Admin/Members/BadgeListAction.php | 2 + .../Admin/Members/BadgeNewAction.php | 2 + .../Admin/Members/CompanyAction.php | 2 + .../Admin/Members/CompanyDeleteAction.php | 2 + .../Admin/Members/CompanyListAction.php | 2 + .../Members/GeneralMeeting/EditAction.php | 2 + .../Members/GeneralMeeting/ListAction.php | 2 + .../Members/GeneralMeeting/ListingAction.php | 2 + .../Members/GeneralMeeting/PrepareAction.php | 2 + .../Members/GeneralMeeting/ReportsAction.php | 2 + .../GeneralMeetingQuestion/AddAction.php | 2 + .../GeneralMeetingQuestion/DeleteAction.php | 2 + .../GeneralMeetingQuestion/EditAction.php | 2 + .../GeneralMeetingVote/CloseAction.php | 2 + .../Members/GeneralMeetingVote/ListAction.php | 2 + .../Members/GeneralMeetingVote/OpenAction.php | 2 + .../Admin/Members/UserAddAction.php | 2 + .../Admin/Members/UserBadgeDeleteAction.php | 2 + .../Admin/Members/UserBadgeNewAction.php | 2 + .../Admin/Members/UserDeleteAction.php | 2 + .../Admin/Members/UserEditAction.php | 2 + .../Admin/Members/UserExportAction.php | 2 + .../Admin/Members/UserListAction.php | 2 + .../Admin/Members/UserResetPasswordAction.php | 2 + .../Admin/Members/UserSendWelcomeAction.php | 2 + .../Admin/Membership/ReminderLogAction.php | 2 + .../Admin/Planete/FeedAddAction.php | 2 + .../Admin/Planete/FeedArticleListAction.php | 2 + .../Admin/Planete/FeedDeleteAction.php | 2 + .../Admin/Planete/FeedEditAction.php | 2 + .../Admin/Planete/FeedListAction.php | 2 + .../Admin/Site/AddRubriqueAction.php | 2 + .../Admin/Site/Article/AddArticleAction.php | 2 + .../Site/Article/DeleteArticleAction.php | 2 + .../Admin/Site/Article/EditArticleAction.php | 2 + .../Admin/Site/Article/ListArticlesAction.php | 2 + .../Admin/Site/DeleteRubriqueAction.php | 2 + .../Admin/Site/EditRubriqueAction.php | 2 + .../Admin/Site/Feuille/AddFeuilleAction.php | 2 + .../Site/Feuille/DeleteFeuilleAction.php | 2 + .../Admin/Site/Feuille/EditFeuilleAction.php | 2 + .../Admin/Site/Feuille/ListFeuillesAction.php | 2 + .../Admin/Site/ListRubriquesAction.php | 2 + .../Admin/SlackMembers/CheckMembersAction.php | 2 + .../Controller/Admin/Speaker/ExportAction.php | 2 + .../Admin/Speaker/SpeakerAddAction.php | 2 + .../Admin/Speaker/SpeakerDeleteAction.php | 2 + .../Admin/Speaker/SpeakerEditAction.php | 2 + .../Speaker/SpeakerLinkGravatarAction.php | 2 + .../Admin/Speaker/SpeakerListAction.php | 2 + .../Admin/Speaker/SpeakerRegisterAction.php | 2 + .../Controller/Admin/SuperApero/AddAction.php | 2 + .../Admin/SuperApero/DeleteAction.php | 2 + .../Admin/SuperApero/EditAction.php | 2 + .../Admin/SuperApero/ListAction.php | 2 + .../Controller/Admin/Talk/AddAction.php | 2 + .../Controller/Admin/Talk/DeleteAction.php | 2 + .../Controller/Admin/Talk/EditAction.php | 2 + .../Controller/Admin/Talk/ExportAction.php | 2 + .../Admin/Talk/ExportJoindInAction.php | 2 + .../Controller/Admin/Talk/IndexAction.php | 2 + .../Admin/Talk/UpdateIndexationAction.php | 2 + .../Admin/TechLetter/GenerateAction.php | 2 + .../Admin/TechLetter/HistoryAction.php | 2 + .../Admin/TechLetter/IndexAction.php | 2 + .../Admin/TechLetter/MembersAction.php | 2 + .../Admin/TechLetter/PreviewAction.php | 2 + .../Admin/TechLetter/RetrieveDataAction.php | 2 + .../Admin/TechLetter/SendTestAction.php | 2 + .../MembershipAdmin/ReportingAction.php | 2 + .../Website/Member/MembersAction.php | 4 +- .../Rule/AdminControllerIsGrantedRule.php | 97 ++++++ .../Security/AdminAccessControlTest.php | 292 ++++++++++++++++++ .../Rule/AdminControllerIsGrantedRuleTest.php | 38 +++ .../phpstan/ControllerClassLevelIsGranted.php | 13 + .../ControllerInvokeLevelIsGranted.php | 13 + .../phpstan/ControllerWithoutIsGranted.php | 10 + .../stubs/phpstan/InvokeWithoutIsGranted.php | 10 + tests/stubs/phpstan/KernelAdminListener.php | 10 + 192 files changed, 955 insertions(+), 79 deletions(-) create mode 100644 sources/AppBundle/StaticAnalysis/Rule/AdminControllerIsGrantedRule.php create mode 100644 tests/integration/AppBundle/Security/AdminAccessControlTest.php create mode 100644 tests/integration/AppBundle/StaticAnalysis/Rule/AdminControllerIsGrantedRuleTest.php create mode 100644 tests/stubs/phpstan/ControllerClassLevelIsGranted.php create mode 100644 tests/stubs/phpstan/ControllerInvokeLevelIsGranted.php create mode 100644 tests/stubs/phpstan/ControllerWithoutIsGranted.php create mode 100644 tests/stubs/phpstan/InvokeWithoutIsGranted.php create mode 100644 tests/stubs/phpstan/KernelAdminListener.php diff --git a/config/packages/backoffice_menu.yaml b/config/packages/backoffice_menu.yaml index b713708e1..e85748f6f 100644 --- a/config/packages/backoffice_menu.yaml +++ b/config/packages/backoffice_menu.yaml @@ -8,12 +8,12 @@ parameters: - admin_home membres: nom: 'Membres' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_MEMBRES_READER' icon: 'user' elements: personnes_physiques: nom: 'Personnes physiques' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_MEMBRES_READER' url: '/admin/members/users' extra_routes: - admin_slack_members_check @@ -22,7 +22,7 @@ parameters: - admin_members_user_edit personnes_morales: nom: 'Personnes morales' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_MEMBRES_READER' url: '/admin/members/companies' extra_routes: - admin_members_company_list @@ -30,55 +30,55 @@ parameters: - admin_members_company_edit relances_personnes_physiques: nom: 'Relances cotisations' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_MEMBRES_READER' url: '/admin/association/relances/1' extra_routes: - admin_relances reporting: nom: 'Reporting' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_MEMBRES_READER' url: '/admin/members/reporting' extra_routes: - admin_members_reporting badges: nom: 'Badges' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_MEMBRES_READER' url: '/admin/members/badges' extra_routes: - admin_members_badges_index - admin_members_badges_new veille: nom: "Veille" - niveau: "ROLE_VEILLE" + niveau: 'ROLE_VEILLE_READER' icon: 'bullhorn' elements: veille_ generer_campagne: nom: "Campagnes" - niveau: "ROLE_VEILLE" + niveau: 'ROLE_VEILLE_READER' url: '/admin/techletter' extra_routes: - admin_techletter_index - admin_techletter_generate techletter: nom: 'Abonnés' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_SUPER_ADMIN' url: '/admin/techletter/members' extra_routes: - admin_techletter_members history: nom: 'Historique' - niveau: 'ROLE_VEILLE' + niveau: 'ROLE_VEILLE_READER' url: '/admin/techletter/history' extra_routes: - admin_techletter_history site: nom: 'Site' - niveau: 'ROLE_SITE' + niveau: 'ROLE_SITE_READER' icon: "paint brush" elements: site_feuilles: nom: 'Feuilles' - niveau: 'ROLE_SITE' + niveau: 'ROLE_SITE_READER' url : '/admin/site/feuilles' extra_routes: - admin_site_feuilles_list @@ -86,7 +86,7 @@ parameters: - admin_site_feuilles_edit site_rubriques: nom: 'Rubriques' - niveau: 'ROLE_SITE' + niveau: 'ROLE_SITE_READER' url : '/admin/site/rubriques' extra_routes: - admin_site_rubriques_list @@ -94,7 +94,7 @@ parameters: - admin_site_rubriques_edit site_articles: nom: 'Articles' - niveau: 'ROLE_SITE' + niveau: 'ROLE_SITE_READER' url : '/admin/site/articles' extra_routes: - admin_site_articles_list @@ -102,7 +102,7 @@ parameters: - admin_site_articles_edit super_apero_infos: nom: 'Super Apéro' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_APERO_READER' url: '/admin/super-apero' extra_routes: - admin_super_apero_list @@ -110,12 +110,12 @@ parameters: - admin_super_apero_edit forum: nom: 'Évènements' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' icon: "globe" elements: forum_gestion: nom: 'Liste' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/list' extra_routes: - admin_event_list @@ -123,19 +123,19 @@ parameters: - admin_event_edit forum_salle: nom: 'Salles' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/room' extra_routes: - admin_event_room forum_suivi: nom: 'Suivi' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/stats' extra_routes: - admin_event_stats forum_inscriptions: nom: 'Inscriptions' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/tickets' extra_routes: - admin_event_ticket_list @@ -143,25 +143,25 @@ parameters: - admin_event_ticket_edit forum_pending_bankwires: nom: 'Virements en attente' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/bankwires' extra_routes: - admin_event_pending_bankwires admin_event_sponsor_ticket: nom: 'Tokens sponsors' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/sponsor' extra_routes: - admin_event_sponsor_ticket admin_event_special_price: nom: 'Tokens visiteurs' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/special_price' extra_routes: - admin_event_special_price admin_event_billeterie_privee: nom: 'Billeteries privées' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/billeterie-privee' extra_routes: - admin_event_billeterie_privee @@ -170,7 +170,7 @@ parameters: - admin_event_billeterie_privee_delete admin_event_prices: nom: 'Tarifications' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/prices' extra_routes: - admin_event_prices @@ -178,13 +178,13 @@ parameters: - admin_event_prices_edit admin_event_factures: nom: "Factures d'évènement" - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/invoices' extra_routes: - admin_event_factures talks: nom: 'Conférences' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/talk/' extra_routes: - admin_talk_list @@ -192,7 +192,7 @@ parameters: - admin_talk_edit admin_event_themes_list: nom: 'Thèmes' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/themes' extra_routes: - admin_event_themes_list @@ -200,19 +200,19 @@ parameters: - admin_event_themes_edit admin_event_editorialization: nom: 'Éditorialisation' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/editorialization' extra_routes: - admin_event_editorialization forum_vote_github: nom: 'Votes visiteurs' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/votes/' extra_routes: - admin_event_votes forum_conferenciers: nom: 'Speakers' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/speaker/' extra_routes: - admin_speaker_list @@ -220,13 +220,13 @@ parameters: - admin_speaker_edit admin_event_speakers_management: nom: 'Infos speakers' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/speakers-management' extra_routes: - admin_event_speakers_management admin_event_interview_list: nom: 'Interviews' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/interviews' extra_routes: - admin_event_interview_list @@ -235,32 +235,33 @@ parameters: - admin_event_interview_config admin_event_speakers_expenses: nom: 'Justificatifs speakers' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/speakers-expenses' extra_routes: - admin_event_speakers_expenses forum_planning: nom: 'Planning' - niveau: 'ROLE_FORUM' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/sessions' extra_routes: - admin_event_sessions - admin_event_sessions_edit admin_github_user_list: nom: 'Github Users' + niveau: 'ROLE_EVENT_READER' url: '/admin/event/github-user' extra_routes: - admin_github_user_add - admin_github_user_list tresorerie: nom: 'Trésorerie' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_COMPTA_READER' icon: "money bill alternate" elements: compta_devis: nom: 'Devis' url: '/admin/accounting/quotations/list' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_COMPTA_READER' extra_routes: - admin_accounting_quotations_list - admin_accounting_quotations_add @@ -268,14 +269,14 @@ parameters: compta_facture: nom: 'Factures' url: '/admin/accounting/invoices/list' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_COMPTA_READER' extra_routes: - admin_accounting_invoices_list - admin_accounting_invoices_edit compta_journal: nom: 'Journal' url: '/admin/accounting/journal/list' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_COMPTA_READER' extra_routes: - admin_accounting_journal_list - admin_accounting_journal_add @@ -283,7 +284,7 @@ parameters: - admin_accounting_journal_import compta_conf_evenement: nom: 'Configuration' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_COMPTA_READER' url: '/admin/accounting/configuration/events/list' extra_routes: - admin_accounting_events_list @@ -294,7 +295,7 @@ parameters: - admin_accounting_rules_list compta_produits: nom: 'Produits' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_COMPTA_READER' url: '/admin/accounting/produits' extra_routes: - admin_accounting_produits_list @@ -302,18 +303,18 @@ parameters: - admin_accounting_produits_edit compta_recherche: nom: 'Recherche comptable' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_COMPTA_READER' url: '/admin/accounting/search' extra_routes: - admin_accounting_search assemblee_generale: nom: 'Assemblée générale' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_AG_READER' icon: 'comments' elements: assemblee_generale_infos: nom: 'Informations' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_AG_READER' url: '/admin/members/general_meeting' extra_routes: - admin_members_general_meeting @@ -322,7 +323,7 @@ parameters: - admin_members_general_meeting_reports assemblee_generale_votes: nom: 'Votes' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_AG_READER' url: '/admin/members/general_meeting_vote' extra_routes: - admin_members_general_vote_list @@ -330,12 +331,12 @@ parameters: - admin_members_general_question_edit planete: nom: 'Planète PHP FR' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_PLANETE_READER' icon: "rss" elements: planete_flux: nom: 'Flux' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_PLANETE_READER' url: '/admin/planete/feeds' extra_routes: - admin_planete_feed_list @@ -344,41 +345,41 @@ parameters: planete_billet: nom: 'Billets' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_PLANETE_READER' url: '/admin/planete/feed-articles' extra_routes: - admin_planete_feed_article_list antenne: nom: 'Antennes' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_ANTENNES_READER' icon: 'map marker alternate piece' elements: antennes_index: nom: 'Liste' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_ANTENNES_READER' url: '/admin/antennes' extra_routes: - admin_antennes_list divers: nom: 'Divers' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_SUPER_ADMIN' icon: "tag" elements: membre_administrateur: nom: 'Administrateurs du site' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_SUPER_ADMIN' url: '/admin/administrators' extra_routes: - admin_administrators logs: nom: 'Logs' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_SUPER_ADMIN' url: '/admin/logs' extra_routes: - admin_logs healthcheck: nom: 'Healthcheck' - niveau: 'ROLE_ADMIN' + niveau: 'ROLE_SUPER_ADMIN' url: '/admin/healthcheck' extra_routes: - admin_healthcheck diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 23c44f36d..aa9cee0d9 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -52,23 +52,15 @@ security: - { path: ^/event/vote/, roles: ROLE_GITHUB } - { path: ^(/event/.*/(vote|cfp|speaker-infos)|/connect/github/check|/event/speaker-infos), roles: ROLE_GITHUB } - { path: ^/(login|register|password-reset), roles: PUBLIC_ACCESS } - - { path: ^/admin/techletter/members, roles: ROLE_ADMIN } - - { path: ^/admin/techletter, roles: ROLE_VEILLE } - - { path: ^/admin/company, roles: ROLE_COMPANY_MANAGER } - - { path: ^/admin/members/badges, roles: ROLE_ADMIN } - - { path: ^/admin/members/users, roles: ROLE_ADMIN } - - { path: ^/admin/members/companies, roles: ROLE_ADMIN } - - { path: ^/admin/event/speakers-management, roles: ROLE_FORUM } - - { path: ^/admin/event/interviews, roles: ROLE_FORUM } - - { path: ^/admin/event, roles: ROLE_ADMIN } - - { path: ^/admin/members/general_meeting, roles: ROLE_ADMIN } - - { path: ^/admin/members/general_meeting_vote, roles: ROLE_ADMIN } - - { path: ^/admin/site, roles: ROLE_ADMIN } - - { path: ^/admin/planete, roles: ROLE_ADMIN } - - { path: ^/admin/accounting, roles: ROLE_ADMIN } - - { path: ^/admin/(members/reporting|association/relances|talk|slackmembers/check|healthcheck), roles: ROLE_ADMIN} - - { path: ^/member, roles: [ROLE_USER, ROLE_MEMBER_EXPIRED]} - - { path: ^/admin/, roles: ROLE_MEMBER_EXPIRED } + - { path: ^/member, roles: [ROLE_USER, ROLE_MEMBER_EXPIRED] } + # ─── Redirections legacy du domaine authentification (login/logout/password) : publiques ─── + - { path: ^/admin/(login|logout|password), roles: PUBLIC_ACCESS } + # ─── Console : toute personne ayant un rôle fonctionnel (READ ⩾) passe + # (dashboard /admin/ compris) ; anonymes → redirection login, + # membres simples → 403. ─── + - { path: ^/admin, roles: ROLE_ADMIN } + # ─── 4 pages SUPER_ADMIN (administrators, logs, healthcheck, techletter/members) : + # fermées par attributs #[IsGranted] en code, pas par YAML ─── - { path: ^/blog, allow_if: "request.getClientIp() in ['217.70.189.71', '127.0.0.1', '192.168.42.1'] or request.server.get('ALLOW_BLOG_FROM_ALL') == 1 or request.headers.get('x-afup-blog-api-key') == '%env(BLOG_API_KEY)%'" } - { path: ^/blog, roles: ROLE_NO_ACCESS } - { path: ^/(event/\w+/tickets|association)paybox-callback, roles: PUBLIC_ACCESS, ips: "%paybox_ips%" } @@ -77,6 +69,35 @@ security: role_hierarchy: ROLE_USER: [ROLE_MEMBER_EXPIRED] - ROLE_COMPANY_MANAGER: [ROLE_USER] - ROLE_ADMIN: [ROLE_USER, ROLE_DEPLOY, ROLE_APERO, ROLE_ANNUAIRE, ROLE_FORUM, ROLE_SITE, ROLE_VEILLE] - ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] + # Company managers keep self-service access (bridge, data migration pending) + ROLE_COMPANY_MANAGER: [ROLE_USER, ROLE_MEMBRES_READER] + # ─── Marqueur console vide : ne donne accès à rien ─── + ROLE_ADMIN: [] + # ─── Pont rôles legacy → rôles fonctionnels (migration des comptes DB) ─── + ROLE_VEILLE: [ROLE_VEILLE_READER] + ROLE_ANNUAIRE: [ROLE_MEMBRES_READER] + ROLE_SITE: [ROLE_SITE_READER] + ROLE_APERO: [ROLE_APERO_READER] + ROLE_FORUM: [ROLE_EVENT_READER] + ROLE_ANTENNE: [ROLE_ANTENNES_READER] + # ─── READ ⇒ console + WRITE ⇒ READ ─── + ROLE_MEMBRES_READER: [ROLE_ADMIN] + ROLE_MEMBRES_WRITER: [ROLE_MEMBRES_READER] + ROLE_VEILLE_READER: [ROLE_ADMIN] + ROLE_VEILLE_WRITER: [ROLE_VEILLE_READER] + ROLE_SITE_READER: [ROLE_ADMIN] + ROLE_SITE_WRITER: [ROLE_SITE_READER] + ROLE_APERO_READER: [ROLE_ADMIN] + ROLE_APERO_WRITER: [ROLE_APERO_READER] + ROLE_EVENT_READER: [ROLE_ADMIN] + ROLE_EVENT_WRITER: [ROLE_EVENT_READER] + ROLE_COMPTA_READER: [ROLE_ADMIN] + ROLE_COMPTA_WRITER: [ROLE_COMPTA_READER] + ROLE_AG_READER: [ROLE_ADMIN] + ROLE_AG_WRITER: [ROLE_AG_READER] + ROLE_PLANETE_READER: [ROLE_ADMIN] + ROLE_PLANETE_WRITER: [ROLE_PLANETE_READER] + ROLE_ANTENNES_READER: [ROLE_ADMIN] + ROLE_ANTENNES_WRITER: [ROLE_ANTENNES_READER] + # ─── Super admin : tout READ + impersonation ─── + ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH, ROLE_MEMBRES_READER, ROLE_VEILLE_READER, ROLE_SITE_READER, ROLE_APERO_READER, ROLE_EVENT_READER, ROLE_COMPTA_READER, ROLE_AG_READER, ROLE_PLANETE_READER, ROLE_ANTENNES_READER] diff --git a/db/seeds/Users.php b/db/seeds/Users.php index 91369930a..ef12b8389 100644 --- a/db/seeds/Users.php +++ b/db/seeds/Users.php @@ -74,7 +74,18 @@ public function run(): void 'prenom' => 'Admin', 'email' => 'admin@admin.fr', 'niveau_modules' => '00000', - 'roles' => '', + 'roles' => json_encode([ + 'ROLE_SUPER_ADMIN', + 'ROLE_MEMBRES_WRITER', + 'ROLE_VEILLE_WRITER', + 'ROLE_SITE_WRITER', + 'ROLE_APERO_WRITER', + 'ROLE_EVENT_WRITER', + 'ROLE_COMPTA_WRITER', + 'ROLE_AG_WRITER', + 'ROLE_PLANETE_WRITER', + 'ROLE_ANTENNES_WRITER', + ]), 'adresse' => '', ], // utilisateur ayant expiré, avec une date de cotisation fixe, utile pour les tests diff --git a/phpstan.neon b/phpstan.neon index 518a44700..3ea082328 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -22,5 +22,6 @@ parameters: rules: - AppBundle\StaticAnalysis\Rule\NoDebugFunctionsRule - AppBundle\StaticAnalysis\Rule\NoGetUserMethodRule + - AppBundle\StaticAnalysis\Rule\AdminControllerIsGrantedRule - AppBundle\StaticAnalysis\Rule\DoctrineRepositoryRule - AppBundle\StaticAnalysis\Rule\DoctrineDisableDQLRule diff --git a/sources/AppBundle/Association/Model/User.php b/sources/AppBundle/Association/Model/User.php index 8108f8ba7..ab35ec2f4 100644 --- a/sources/AppBundle/Association/Model/User.php +++ b/sources/AppBundle/Association/Model/User.php @@ -622,7 +622,10 @@ public function getRoles(): array $defaultRoles = ['ROLE_MEMBER_EXPIRED']; } if ($this->level === self::LEVEL_ADMIN) { - $defaultRoles[] = 'ROLE_SUPER_ADMIN'; + // Un admin de base console seulement : ROLE_ADMIN est vide (marqueur d'accès console). + // Les droits fonctionnels viennent des levelModules ci-dessous. + // ROLE_SUPER_ADMIN est désormais réservé et ne doit plus être attribué automatiquement. + $defaultRoles[] = 'ROLE_ADMIN'; } if (isset($this->levelModules[0]) && (int) $this->levelModules[0] > 0) { $defaultRoles[] = 'ROLE_APERO'; @@ -643,7 +646,7 @@ public function getRoles(): array // On enlève le rôle ROLE_MEMBER_EXPIRED vu qu'il est défini en fonction de la cotisation dans les defaultRoles // on fait de même avec tous les autres rôles définis en fonction des champs levelModules car ils peuvent se retrouver // en base dans le tableau de rôle, et on ne veux pas que si on modifie le levelModules pour l'enlever, il reste via le roles - $userRoles = array_diff($this->roles, ['ROLE_MEMBER_EXPIRED', 'ROLE_SUPER_ADMIN', 'ROLE_APERO', 'ROLE_ANNUAIRE', 'ROLE_SITE', 'ROLE_FORUM', 'ROLE_ANTENNE']); + $userRoles = array_diff($this->roles, ['ROLE_MEMBER_EXPIRED', 'ROLE_APERO', 'ROLE_ANNUAIRE', 'ROLE_SITE', 'ROLE_FORUM', 'ROLE_ANTENNE']); return array_unique(array_merge($userRoles, $defaultRoles)); } diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddAccountAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddAccountAction.php index 13d7a4b25..ae37735c3 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddAccountAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddAccountAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class AddAccountAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddCategoryAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddCategoryAction.php index 64077bc19..20d939b42 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddCategoryAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddCategoryAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class AddCategoryAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddEventAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddEventAction.php index 105c30230..6659e5f6e 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddEventAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddEventAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class AddEventAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddOperationAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddOperationAction.php index c9eb60bf9..701eaee69 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddOperationAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddOperationAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class AddOperationAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddPaymentAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddPaymentAction.php index 6e9f882cf..0b2e5d32a 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddPaymentAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddPaymentAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class AddPaymentAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddRuleAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddRuleAction.php index 3b0f96a8f..34155fe72 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddRuleAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/AddRuleAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class AddRuleAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ArchiveAccountAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ArchiveAccountAction.php index cd2d4b0e1..69e27cdb1 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ArchiveAccountAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ArchiveAccountAction.php @@ -8,7 +8,9 @@ use AppBundle\Accounting\Entity\Repository\AccountRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class ArchiveAccountAction extends AbstractController { public function __construct(private readonly AccountRepository $accountRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditAccountAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditAccountAction.php index a8c0fc892..d5eca2126 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditAccountAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditAccountAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class EditAccountAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditCategoryAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditCategoryAction.php index cdde749f6..fc5b13834 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditCategoryAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditCategoryAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class EditCategoryAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditEventAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditEventAction.php index 85540e2ba..5f981450c 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditEventAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditEventAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class EditEventAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditOperationAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditOperationAction.php index cbe3394f0..21578a11d 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditOperationAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditOperationAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class EditOperationAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditPaymentAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditPaymentAction.php index f416352ea..37259ad78 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditPaymentAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditPaymentAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class EditPaymentAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditRuleAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditRuleAction.php index 210291e19..a6c1273c1 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditRuleAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/EditRuleAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class EditRuleAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListAccountAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListAccountAction.php index 2023632d2..184ffc925 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListAccountAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListAccountAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ListAccountAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListCategoryAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListCategoryAction.php index 0dceef00a..087ac0af6 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListCategoryAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListCategoryAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] final readonly class ListCategoryAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListEventAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListEventAction.php index 321d0385f..005040c43 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListEventAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListEventAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ListEventAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListOperationAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListOperationAction.php index 26c5c2a57..13842e95a 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListOperationAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListOperationAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ListOperationAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListPaymentAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListPaymentAction.php index 948ea8f68..054ec3ac9 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListPaymentAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListPaymentAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ListPaymentAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListRuleAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListRuleAction.php index a36888844..ee7c8a0bb 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListRuleAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/ListRuleAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ListRuleAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Configuration/RestoreAccountAction.php b/sources/AppBundle/Controller/Admin/Accounting/Configuration/RestoreAccountAction.php index da71965db..fe0e56903 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Configuration/RestoreAccountAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Configuration/RestoreAccountAction.php @@ -8,7 +8,9 @@ use AppBundle\Accounting\Entity\Repository\AccountRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class RestoreAccountAction extends AbstractController { public function __construct(private readonly AccountRepository $accountRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Accounting/Invoice/DownloadInvoiceAction.php b/sources/AppBundle/Controller/Admin/Accounting/Invoice/DownloadInvoiceAction.php index 8537169f6..8e31765d0 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Invoice/DownloadInvoiceAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Invoice/DownloadInvoiceAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class DownloadInvoiceAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Invoice/EditInvoiceAction.php b/sources/AppBundle/Controller/Admin/Accounting/Invoice/EditInvoiceAction.php index 364b043f6..a5398bb6f 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Invoice/EditInvoiceAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Invoice/EditInvoiceAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class EditInvoiceAction extends AbstractController { public function __construct(private readonly InvoicingRepository $invoicingRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Accounting/Invoice/ListInvoiceAction.php b/sources/AppBundle/Controller/Admin/Accounting/Invoice/ListInvoiceAction.php index 484557269..dd85e3323 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Invoice/ListInvoiceAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Invoice/ListInvoiceAction.php @@ -14,7 +14,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ListInvoiceAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Invoice/MarkFactureAsSentAction.php b/sources/AppBundle/Controller/Admin/Accounting/Invoice/MarkFactureAsSentAction.php index c51489f07..16020a560 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Invoice/MarkFactureAsSentAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Invoice/MarkFactureAsSentAction.php @@ -14,7 +14,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class MarkFactureAsSentAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Invoice/SendInvoiceEmailAction.php b/sources/AppBundle/Controller/Admin/Accounting/Invoice/SendInvoiceEmailAction.php index 6968291fd..1cffd8c23 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Invoice/SendInvoiceEmailAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Invoice/SendInvoiceEmailAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class SendInvoiceEmailAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/AddTransactionAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/AddTransactionAction.php index 1953a7a18..ed4b35074 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/AddTransactionAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/AddTransactionAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class AddTransactionAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/AllocateAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/AllocateAction.php index 2c3710545..869d329bf 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/AllocateAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/AllocateAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class AllocateAction extends AbstractController { public function __construct(private readonly TransactionRepository $transactionRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/DeleteAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/DeleteAction.php index 65ab0014a..7a9935bc2 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/DeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/DeleteAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class DeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentAction.php index 338aa0d4b..08ac376a2 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class DownloadAttachmentAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentsAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentsAction.php index 39175dc84..e91c70cbc 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentsAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentsAction.php @@ -14,7 +14,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use ZipArchive; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class DownloadAttachmentsAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/EditTransactionAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/EditTransactionAction.php index fe3c04a33..17775c975 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/EditTransactionAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/EditTransactionAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class EditTransactionAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/ExportAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/ExportAction.php index ca2729052..d8b626239 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/ExportAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/ExportAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\ResponseHeaderBag; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ExportAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/ImportAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/ImportAction.php index e58b86fa4..b8961a5db 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/ImportAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/ImportAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class ImportAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/ListAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/ListAction.php index 2a7810baa..301f51777 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/ListAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/ListAction.php @@ -14,7 +14,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ListAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/UpdateInfoAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/UpdateInfoAction.php index 3ddfa2d23..7c06bf346 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/UpdateInfoAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/UpdateInfoAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class UpdateInfoAction extends AbstractController { public function __construct(private readonly TransactionRepository $transactionRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/UploadAttachmentAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/UploadAttachmentAction.php index 046db6b2b..2163ca315 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/UploadAttachmentAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/UploadAttachmentAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Validator\Constraints\File; use Symfony\Component\Validator\Validator\ValidatorInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class UploadAttachmentAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/AddMembershipFeeAction.php b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/AddMembershipFeeAction.php index d1ccb2179..ac775bbca 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/AddMembershipFeeAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/AddMembershipFeeAction.php @@ -15,7 +15,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class AddMembershipFeeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/DeleteMembershipFeeAction.php b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/DeleteMembershipFeeAction.php index 6add1dfa2..d0c68a0d5 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/DeleteMembershipFeeAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/DeleteMembershipFeeAction.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class DeleteMembershipFeeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/DownloadMembershipFeeInvoiceAction.php b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/DownloadMembershipFeeInvoiceAction.php index cef89234d..5e85fe032 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/DownloadMembershipFeeInvoiceAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/DownloadMembershipFeeInvoiceAction.php @@ -8,7 +8,9 @@ use AppBundle\Association\MemberType; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class DownloadMembershipFeeInvoiceAction extends AbstractController { public function __construct(private readonly MembershipFeeInvoicePdfGenerator $pdfGenerator) {} diff --git a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/EditMembershipFeeAction.php b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/EditMembershipFeeAction.php index e42bcbbfa..45fa7895c 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/EditMembershipFeeAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/EditMembershipFeeAction.php @@ -13,7 +13,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class EditMembershipFeeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/ListMembershipFeeAction.php b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/ListMembershipFeeAction.php index be3f49c9d..56ae8ae52 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/ListMembershipFeeAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/ListMembershipFeeAction.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Attribute\CurrentUser; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ListMembershipFeeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/SendMembershipFeeInvoiceAction.php b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/SendMembershipFeeInvoiceAction.php index cab1504f0..befb8b89a 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/SendMembershipFeeInvoiceAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/MembershipFee/SendMembershipFeeInvoiceAction.php @@ -9,7 +9,9 @@ use AppBundle\AuditLog\Audit; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class SendMembershipFeeInvoiceAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Produit/AddProduitAction.php b/sources/AppBundle/Controller/Admin/Accounting/Produit/AddProduitAction.php index 22378f5d6..96d9e942c 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Produit/AddProduitAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Produit/AddProduitAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class AddProduitAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Produit/DeleteProduitAction.php b/sources/AppBundle/Controller/Admin/Accounting/Produit/DeleteProduitAction.php index d9b0e03ee..98ea43e49 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Produit/DeleteProduitAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Produit/DeleteProduitAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class DeleteProduitAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Produit/EditProduitAction.php b/sources/AppBundle/Controller/Admin/Accounting/Produit/EditProduitAction.php index 3e512667e..b2d9408bf 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Produit/EditProduitAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Produit/EditProduitAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] final class EditProduitAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Produit/ListProduitAction.php b/sources/AppBundle/Controller/Admin/Accounting/Produit/ListProduitAction.php index 451ab623d..c2dcfa22a 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Produit/ListProduitAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Produit/ListProduitAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] final readonly class ListProduitAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Quotation/AddQuotationAction.php b/sources/AppBundle/Controller/Admin/Accounting/Quotation/AddQuotationAction.php index d84092380..2d8220dcc 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Quotation/AddQuotationAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Quotation/AddQuotationAction.php @@ -15,7 +15,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class AddQuotationAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Quotation/ConvertQuotationAction.php b/sources/AppBundle/Controller/Admin/Accounting/Quotation/ConvertQuotationAction.php index b1e7c7e0c..855a1d058 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Quotation/ConvertQuotationAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Quotation/ConvertQuotationAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class ConvertQuotationAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Quotation/DownloadQuotationAction.php b/sources/AppBundle/Controller/Admin/Accounting/Quotation/DownloadQuotationAction.php index 86bcdcbb7..d2a27cd60 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Quotation/DownloadQuotationAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Quotation/DownloadQuotationAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class DownloadQuotationAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Quotation/EditQuotationAction.php b/sources/AppBundle/Controller/Admin/Accounting/Quotation/EditQuotationAction.php index 58156dfec..3379d846a 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Quotation/EditQuotationAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Quotation/EditQuotationAction.php @@ -12,7 +12,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_WRITER')] class EditQuotationAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/Quotation/ListQuotationAction.php b/sources/AppBundle/Controller/Admin/Accounting/Quotation/ListQuotationAction.php index 34218afc5..2cb2690aa 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Quotation/ListQuotationAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Quotation/ListQuotationAction.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class ListQuotationAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Accounting/SearchAction.php b/sources/AppBundle/Controller/Admin/Accounting/SearchAction.php index 4ea8d8849..c1c9639dc 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/SearchAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/SearchAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_COMPTA_READER')] class SearchAction extends AbstractController { public function __construct(private readonly SearchResultProvider $searchResultProvider) {} diff --git a/sources/AppBundle/Controller/Admin/AdministratorsListAction.php b/sources/AppBundle/Controller/Admin/AdministratorsListAction.php index 88600ba96..4ef54ce1a 100644 --- a/sources/AppBundle/Controller/Admin/AdministratorsListAction.php +++ b/sources/AppBundle/Controller/Admin/AdministratorsListAction.php @@ -7,7 +7,9 @@ use AppBundle\Association\Model\Repository\UserRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SUPER_ADMIN')] class AdministratorsListAction extends AbstractController { public function __construct(private readonly UserRepository $userRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Antennes/AntenneListAction.php b/sources/AppBundle/Controller/Admin/Antennes/AntenneListAction.php index 7db3e4291..323772c5a 100644 --- a/sources/AppBundle/Controller/Admin/Antennes/AntenneListAction.php +++ b/sources/AppBundle/Controller/Admin/Antennes/AntenneListAction.php @@ -9,7 +9,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_ANTENNES_READER')] final readonly class AntenneListAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Audit/IndexAction.php b/sources/AppBundle/Controller/Admin/Audit/IndexAction.php index 62dd26f8c..1b8ea4109 100644 --- a/sources/AppBundle/Controller/Admin/Audit/IndexAction.php +++ b/sources/AppBundle/Controller/Admin/Audit/IndexAction.php @@ -7,7 +7,9 @@ use AppBundle\AuditLog\AuditLogRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SUPER_ADMIN')] final class IndexAction extends AbstractController { public function __construct(private readonly AuditLogRepository $auditLogRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Event/AddBilleteriePriveeAction.php b/sources/AppBundle/Controller/Admin/Event/AddBilleteriePriveeAction.php index 99061b727..10f98f874 100644 --- a/sources/AppBundle/Controller/Admin/Event/AddBilleteriePriveeAction.php +++ b/sources/AppBundle/Controller/Admin/Event/AddBilleteriePriveeAction.php @@ -13,7 +13,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class AddBilleteriePriveeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/ArchiveAction.php b/sources/AppBundle/Controller/Admin/Event/ArchiveAction.php index 45e506aba..6a525f750 100644 --- a/sources/AppBundle/Controller/Admin/Event/ArchiveAction.php +++ b/sources/AppBundle/Controller/Admin/Event/ArchiveAction.php @@ -8,7 +8,9 @@ use AppBundle\Event\Model\Repository\EventRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] final class ArchiveAction extends AbstractController { public function __construct(private readonly EventRepository $eventRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Event/BadgesGenerateAction.php b/sources/AppBundle/Controller/Admin/Event/BadgesGenerateAction.php index 93e1bb533..b7ce771c0 100644 --- a/sources/AppBundle/Controller/Admin/Event/BadgesGenerateAction.php +++ b/sources/AppBundle/Controller/Admin/Event/BadgesGenerateAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\ResponseHeaderBag; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class BadgesGenerateAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/BilleteriePriveeAction.php b/sources/AppBundle/Controller/Admin/Event/BilleteriePriveeAction.php index 8dea5aff8..d340b7a62 100644 --- a/sources/AppBundle/Controller/Admin/Event/BilleteriePriveeAction.php +++ b/sources/AppBundle/Controller/Admin/Event/BilleteriePriveeAction.php @@ -9,7 +9,9 @@ use AppBundle\Event\Model\Repository\TicketTypeRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class BilleteriePriveeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/DeleteBilleteriePriveeAction.php b/sources/AppBundle/Controller/Admin/Event/DeleteBilleteriePriveeAction.php index 6b40a4651..fc8e160a6 100644 --- a/sources/AppBundle/Controller/Admin/Event/DeleteBilleteriePriveeAction.php +++ b/sources/AppBundle/Controller/Admin/Event/DeleteBilleteriePriveeAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class DeleteBilleteriePriveeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/DeleteSponsorTicketAction.php b/sources/AppBundle/Controller/Admin/Event/DeleteSponsorTicketAction.php index b4552e25b..c267086d5 100644 --- a/sources/AppBundle/Controller/Admin/Event/DeleteSponsorTicketAction.php +++ b/sources/AppBundle/Controller/Admin/Event/DeleteSponsorTicketAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class DeleteSponsorTicketAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/EditBilleteriePriveeAction.php b/sources/AppBundle/Controller/Admin/Event/EditBilleteriePriveeAction.php index 83d4f8750..dd116bf7f 100644 --- a/sources/AppBundle/Controller/Admin/Event/EditBilleteriePriveeAction.php +++ b/sources/AppBundle/Controller/Admin/Event/EditBilleteriePriveeAction.php @@ -13,7 +13,9 @@ use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class EditBilleteriePriveeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/EventAction.php b/sources/AppBundle/Controller/Admin/Event/EventAction.php index 3e1610b05..55f8759d9 100644 --- a/sources/AppBundle/Controller/Admin/Event/EventAction.php +++ b/sources/AppBundle/Controller/Admin/Event/EventAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class EventAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/EventEditorializationAction.php b/sources/AppBundle/Controller/Admin/Event/EventEditorializationAction.php index 937ebe31e..c1e539d36 100644 --- a/sources/AppBundle/Controller/Admin/Event/EventEditorializationAction.php +++ b/sources/AppBundle/Controller/Admin/Event/EventEditorializationAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class EventEditorializationAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/EventThemeAction.php b/sources/AppBundle/Controller/Admin/Event/EventThemeAction.php index 10431d338..e6bf83219 100644 --- a/sources/AppBundle/Controller/Admin/Event/EventThemeAction.php +++ b/sources/AppBundle/Controller/Admin/Event/EventThemeAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class EventThemeAction extends AbstractController { public function __construct(private readonly EventThemeRepository $eventThemeRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Event/EventThemeAddEditAction.php b/sources/AppBundle/Controller/Admin/Event/EventThemeAddEditAction.php index 06e231f9e..ff11d7d37 100644 --- a/sources/AppBundle/Controller/Admin/Event/EventThemeAddEditAction.php +++ b/sources/AppBundle/Controller/Admin/Event/EventThemeAddEditAction.php @@ -13,7 +13,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class EventThemeAddEditAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/ExtendSpecialPriceAction.php b/sources/AppBundle/Controller/Admin/Event/ExtendSpecialPriceAction.php index 07babef48..18960deef 100644 --- a/sources/AppBundle/Controller/Admin/Event/ExtendSpecialPriceAction.php +++ b/sources/AppBundle/Controller/Admin/Event/ExtendSpecialPriceAction.php @@ -9,7 +9,9 @@ use AppBundle\Event\Entity\TicketSpecialPrice; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class ExtendSpecialPriceAction extends AbstractController { public function __construct(private readonly TicketSpecialPriceRepository $ticketSpecialPriceRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Event/Facturation/DeleteFactureAction.php b/sources/AppBundle/Controller/Admin/Event/Facturation/DeleteFactureAction.php index dc9fc8239..f8a2c9154 100644 --- a/sources/AppBundle/Controller/Admin/Event/Facturation/DeleteFactureAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Facturation/DeleteFactureAction.php @@ -15,7 +15,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class DeleteFactureAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Facturation/DownloadDevisAction.php b/sources/AppBundle/Controller/Admin/Event/Facturation/DownloadDevisAction.php index bd31c1b36..8ab7c0a6d 100644 --- a/sources/AppBundle/Controller/Admin/Event/Facturation/DownloadDevisAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Facturation/DownloadDevisAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class DownloadDevisAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Facturation/DownloadFactureAction.php b/sources/AppBundle/Controller/Admin/Event/Facturation/DownloadFactureAction.php index 306ae6944..2b294ed59 100644 --- a/sources/AppBundle/Controller/Admin/Event/Facturation/DownloadFactureAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Facturation/DownloadFactureAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class DownloadFactureAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Facturation/IssueFactureAction.php b/sources/AppBundle/Controller/Admin/Event/Facturation/IssueFactureAction.php index 06795b693..383ad6001 100644 --- a/sources/AppBundle/Controller/Admin/Event/Facturation/IssueFactureAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Facturation/IssueFactureAction.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class IssueFactureAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Facturation/ListFacturesAction.php b/sources/AppBundle/Controller/Admin/Event/Facturation/ListFacturesAction.php index d8e8ad5db..4d4d8ece9 100644 --- a/sources/AppBundle/Controller/Admin/Event/Facturation/ListFacturesAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Facturation/ListFacturesAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Webmozart\Assert\Assert; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class ListFacturesAction extends AbstractController { public const array VALID_SORTS = ['date_facture', 'reference', 'societe', 'montant', 'etat', 'facturation']; diff --git a/sources/AppBundle/Controller/Admin/Event/Facturation/SendFactureAction.php b/sources/AppBundle/Controller/Admin/Event/Facturation/SendFactureAction.php index 914aeb27f..cd5db1b17 100644 --- a/sources/AppBundle/Controller/Admin/Event/Facturation/SendFactureAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Facturation/SendFactureAction.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class SendFactureAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Interview/AddOrEditAction.php b/sources/AppBundle/Controller/Admin/Event/Interview/AddOrEditAction.php index 3d66aa673..56b2f1611 100644 --- a/sources/AppBundle/Controller/Admin/Event/Interview/AddOrEditAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Interview/AddOrEditAction.php @@ -21,7 +21,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class AddOrEditAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Interview/ConfigAction.php b/sources/AppBundle/Controller/Admin/Event/Interview/ConfigAction.php index 351bcda56..c740b8fdf 100644 --- a/sources/AppBundle/Controller/Admin/Event/Interview/ConfigAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Interview/ConfigAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] final class ConfigAction extends AbstractController { public function __construct(private readonly EventRepository $eventRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Event/Interview/ListAction.php b/sources/AppBundle/Controller/Admin/Event/Interview/ListAction.php index c5747ce54..3abc2b0ff 100644 --- a/sources/AppBundle/Controller/Admin/Event/Interview/ListAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Interview/ListAction.php @@ -12,7 +12,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class ListAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/ListAction.php b/sources/AppBundle/Controller/Admin/Event/ListAction.php index f5ee7536c..c93727aa0 100644 --- a/sources/AppBundle/Controller/Admin/Event/ListAction.php +++ b/sources/AppBundle/Controller/Admin/Event/ListAction.php @@ -7,7 +7,9 @@ use AppBundle\Event\Model\Repository\EventRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class ListAction extends AbstractController { public function __construct(private readonly EventRepository $eventRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Event/PendingBankwiresAction.php b/sources/AppBundle/Controller/Admin/Event/PendingBankwiresAction.php index cc838e9b2..80941290b 100644 --- a/sources/AppBundle/Controller/Admin/Event/PendingBankwiresAction.php +++ b/sources/AppBundle/Controller/Admin/Event/PendingBankwiresAction.php @@ -21,7 +21,9 @@ use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class PendingBankwiresAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/PreviousRegistrationsAction.php b/sources/AppBundle/Controller/Admin/Event/PreviousRegistrationsAction.php index e6283acb2..3b2500a55 100644 --- a/sources/AppBundle/Controller/Admin/Event/PreviousRegistrationsAction.php +++ b/sources/AppBundle/Controller/Admin/Event/PreviousRegistrationsAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\ResponseHeaderBag; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class PreviousRegistrationsAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/PricesAction.php b/sources/AppBundle/Controller/Admin/Event/PricesAction.php index c1d28a00d..ec139ab63 100644 --- a/sources/AppBundle/Controller/Admin/Event/PricesAction.php +++ b/sources/AppBundle/Controller/Admin/Event/PricesAction.php @@ -8,7 +8,9 @@ use AppBundle\Event\Model\Repository\TicketEventTypeRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class PricesAction extends AbstractController { public function __construct(private readonly TicketEventTypeRepository $ticketEventTypeRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Event/PricesAddAction.php b/sources/AppBundle/Controller/Admin/Event/PricesAddAction.php index dd2108273..453ea609f 100644 --- a/sources/AppBundle/Controller/Admin/Event/PricesAddAction.php +++ b/sources/AppBundle/Controller/Admin/Event/PricesAddAction.php @@ -15,7 +15,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Validator\Validator\ValidatorInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class PricesAddAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php b/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php index b6758d553..115c1fdea 100644 --- a/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php +++ b/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php @@ -13,7 +13,9 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class PricesEditAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/RemoveEventAction.php b/sources/AppBundle/Controller/Admin/Event/RemoveEventAction.php index 0456a6ae4..b163f62fd 100644 --- a/sources/AppBundle/Controller/Admin/Event/RemoveEventAction.php +++ b/sources/AppBundle/Controller/Admin/Event/RemoveEventAction.php @@ -9,7 +9,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class RemoveEventAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/ResendSponsorTokenAction.php b/sources/AppBundle/Controller/Admin/Event/ResendSponsorTokenAction.php index fc161cea2..be792c75d 100644 --- a/sources/AppBundle/Controller/Admin/Event/ResendSponsorTokenAction.php +++ b/sources/AppBundle/Controller/Admin/Event/ResendSponsorTokenAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class ResendSponsorTokenAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/RestoreAction.php b/sources/AppBundle/Controller/Admin/Event/RestoreAction.php index a4b97cc82..f3bce631e 100644 --- a/sources/AppBundle/Controller/Admin/Event/RestoreAction.php +++ b/sources/AppBundle/Controller/Admin/Event/RestoreAction.php @@ -8,7 +8,9 @@ use AppBundle\Event\Model\Repository\EventRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] final class RestoreAction extends AbstractController { public function __construct(private readonly EventRepository $eventRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Event/RoomAction.php b/sources/AppBundle/Controller/Admin/Event/RoomAction.php index 7beb92969..55c81494f 100644 --- a/sources/AppBundle/Controller/Admin/Event/RoomAction.php +++ b/sources/AppBundle/Controller/Admin/Event/RoomAction.php @@ -14,7 +14,9 @@ use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class RoomAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/SendLastCallSponsorTokenAction.php b/sources/AppBundle/Controller/Admin/Event/SendLastCallSponsorTokenAction.php index 3202b1e26..43c00145f 100644 --- a/sources/AppBundle/Controller/Admin/Event/SendLastCallSponsorTokenAction.php +++ b/sources/AppBundle/Controller/Admin/Event/SendLastCallSponsorTokenAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class SendLastCallSponsorTokenAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/SendTestInscriptionEmailAction.php b/sources/AppBundle/Controller/Admin/Event/SendTestInscriptionEmailAction.php index 8f153d696..f9dfc6030 100644 --- a/sources/AppBundle/Controller/Admin/Event/SendTestInscriptionEmailAction.php +++ b/sources/AppBundle/Controller/Admin/Event/SendTestInscriptionEmailAction.php @@ -9,7 +9,9 @@ use AppBundle\Email\Mailer\MailUserFactory; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class SendTestInscriptionEmailAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Session/CalendarAjaxAction.php b/sources/AppBundle/Controller/Admin/Event/Session/CalendarAjaxAction.php index 89772f6e8..cd4cb6a27 100644 --- a/sources/AppBundle/Controller/Admin/Event/Session/CalendarAjaxAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Session/CalendarAjaxAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class CalendarAjaxAction extends AbstractController { public function __construct(private readonly PlanningRepository $planningRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Event/Session/DeleteAction.php b/sources/AppBundle/Controller/Admin/Event/Session/DeleteAction.php index ef200956d..5c44d0ac4 100644 --- a/sources/AppBundle/Controller/Admin/Event/Session/DeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Session/DeleteAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class DeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Session/EditAction.php b/sources/AppBundle/Controller/Admin/Event/Session/EditAction.php index df3dd7b0b..eb22f1ed2 100644 --- a/sources/AppBundle/Controller/Admin/Event/Session/EditAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Session/EditAction.php @@ -19,7 +19,9 @@ use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class EditAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Session/IndexAction.php b/sources/AppBundle/Controller/Admin/Event/Session/IndexAction.php index 9018abc13..db9006a40 100644 --- a/sources/AppBundle/Controller/Admin/Event/Session/IndexAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Session/IndexAction.php @@ -16,7 +16,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] final class IndexAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/SpeakerInfosAction.php b/sources/AppBundle/Controller/Admin/Event/SpeakerInfosAction.php index de6b65a53..f3d4106f5 100644 --- a/sources/AppBundle/Controller/Admin/Event/SpeakerInfosAction.php +++ b/sources/AppBundle/Controller/Admin/Event/SpeakerInfosAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class SpeakerInfosAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/SpeakersExpensesAction.php b/sources/AppBundle/Controller/Admin/Event/SpeakersExpensesAction.php index 1ee63f8e4..29ebcca57 100644 --- a/sources/AppBundle/Controller/Admin/Event/SpeakersExpensesAction.php +++ b/sources/AppBundle/Controller/Admin/Event/SpeakersExpensesAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class SpeakersExpensesAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/SpeakersManagementAction.php b/sources/AppBundle/Controller/Admin/Event/SpeakersManagementAction.php index a228eb26e..dacdc939c 100644 --- a/sources/AppBundle/Controller/Admin/Event/SpeakersManagementAction.php +++ b/sources/AppBundle/Controller/Admin/Event/SpeakersManagementAction.php @@ -9,7 +9,9 @@ use AppBundle\SpeakerInfos\SpeakersExpensesStorage; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class SpeakersManagementAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/SpecialPriceAction.php b/sources/AppBundle/Controller/Admin/Event/SpecialPriceAction.php index 82af4de56..091f02d14 100644 --- a/sources/AppBundle/Controller/Admin/Event/SpecialPriceAction.php +++ b/sources/AppBundle/Controller/Admin/Event/SpecialPriceAction.php @@ -13,7 +13,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class SpecialPriceAction extends AbstractController { public const int EXTEND_DAYS = 3; // jours diff --git a/sources/AppBundle/Controller/Admin/Event/SponsorTicketAction.php b/sources/AppBundle/Controller/Admin/Event/SponsorTicketAction.php index de2ed6a5b..ee1b33f7e 100644 --- a/sources/AppBundle/Controller/Admin/Event/SponsorTicketAction.php +++ b/sources/AppBundle/Controller/Admin/Event/SponsorTicketAction.php @@ -14,7 +14,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class SponsorTicketAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/StatsAction.php b/sources/AppBundle/Controller/Admin/Event/StatsAction.php index 5ae932c0d..d108f0b07 100644 --- a/sources/AppBundle/Controller/Admin/Event/StatsAction.php +++ b/sources/AppBundle/Controller/Admin/Event/StatsAction.php @@ -12,7 +12,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class StatsAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Ticket/AddAction.php b/sources/AppBundle/Controller/Admin/Event/Ticket/AddAction.php index 6257438d3..a47d3243e 100644 --- a/sources/AppBundle/Controller/Admin/Event/Ticket/AddAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Ticket/AddAction.php @@ -18,7 +18,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] final class AddAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Ticket/DeleteAction.php b/sources/AppBundle/Controller/Admin/Event/Ticket/DeleteAction.php index 5b60f430e..82b996fe6 100644 --- a/sources/AppBundle/Controller/Admin/Event/Ticket/DeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Ticket/DeleteAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] final class DeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Ticket/EditAction.php b/sources/AppBundle/Controller/Admin/Event/Ticket/EditAction.php index ad927fac1..2c027f280 100644 --- a/sources/AppBundle/Controller/Admin/Event/Ticket/EditAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Ticket/EditAction.php @@ -16,7 +16,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] final class EditAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/Ticket/IndexAction.php b/sources/AppBundle/Controller/Admin/Event/Ticket/IndexAction.php index ee9cc6de6..edfa93829 100644 --- a/sources/AppBundle/Controller/Admin/Event/Ticket/IndexAction.php +++ b/sources/AppBundle/Controller/Admin/Event/Ticket/IndexAction.php @@ -23,7 +23,9 @@ use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class IndexAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Event/VotesListeAction.php b/sources/AppBundle/Controller/Admin/Event/VotesListeAction.php index 33bf5327a..b87612be9 100644 --- a/sources/AppBundle/Controller/Admin/Event/VotesListeAction.php +++ b/sources/AppBundle/Controller/Admin/Event/VotesListeAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] final class VotesListeAction extends AbstractController { public function __construct(private readonly VoteRepository $voteRepository) {} diff --git a/sources/AppBundle/Controller/Admin/GetMenuAction.php b/sources/AppBundle/Controller/Admin/GetMenuAction.php index f4b20bb0d..5e6fa2ba4 100644 --- a/sources/AppBundle/Controller/Admin/GetMenuAction.php +++ b/sources/AppBundle/Controller/Admin/GetMenuAction.php @@ -9,7 +9,9 @@ use Symfony\Component\HttpFoundation\Response; use Twig\Environment; use Webmozart\Assert\Assert; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_ADMIN')] class GetMenuAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/GithubUser/GithubUserAddAction.php b/sources/AppBundle/Controller/Admin/GithubUser/GithubUserAddAction.php index 9e151a7c0..c63ed8abe 100644 --- a/sources/AppBundle/Controller/Admin/GithubUser/GithubUserAddAction.php +++ b/sources/AppBundle/Controller/Admin/GithubUser/GithubUserAddAction.php @@ -11,7 +11,9 @@ use AppBundle\Github\GithubClient; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class GithubUserAddAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/GithubUser/GithubUserListAction.php b/sources/AppBundle/Controller/Admin/GithubUser/GithubUserListAction.php index 4b915f977..26ab1cc1e 100644 --- a/sources/AppBundle/Controller/Admin/GithubUser/GithubUserListAction.php +++ b/sources/AppBundle/Controller/Admin/GithubUser/GithubUserListAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class GithubUserListAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/HealthcheckController.php b/sources/AppBundle/Controller/Admin/HealthcheckController.php index f519f876a..eb4942b04 100644 --- a/sources/AppBundle/Controller/Admin/HealthcheckController.php +++ b/sources/AppBundle/Controller/Admin/HealthcheckController.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Kernel; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SUPER_ADMIN')] class HealthcheckController extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/HomeAction.php b/sources/AppBundle/Controller/Admin/HomeAction.php index aa49551ce..36b727f4d 100644 --- a/sources/AppBundle/Controller/Admin/HomeAction.php +++ b/sources/AppBundle/Controller/Admin/HomeAction.php @@ -17,7 +17,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_ADMIN')] class HomeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/BadgeListAction.php b/sources/AppBundle/Controller/Admin/Members/BadgeListAction.php index 0762585ac..50d9d20b2 100644 --- a/sources/AppBundle/Controller/Admin/Members/BadgeListAction.php +++ b/sources/AppBundle/Controller/Admin/Members/BadgeListAction.php @@ -9,7 +9,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class BadgeListAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/BadgeNewAction.php b/sources/AppBundle/Controller/Admin/Members/BadgeNewAction.php index 0911a770a..f8a32a79f 100644 --- a/sources/AppBundle/Controller/Admin/Members/BadgeNewAction.php +++ b/sources/AppBundle/Controller/Admin/Members/BadgeNewAction.php @@ -12,7 +12,9 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] final class BadgeNewAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/CompanyAction.php b/sources/AppBundle/Controller/Admin/Members/CompanyAction.php index 02e17ce6b..c098bd16d 100644 --- a/sources/AppBundle/Controller/Admin/Members/CompanyAction.php +++ b/sources/AppBundle/Controller/Admin/Members/CompanyAction.php @@ -12,7 +12,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class CompanyAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/CompanyDeleteAction.php b/sources/AppBundle/Controller/Admin/Members/CompanyDeleteAction.php index a0482b982..972ce932a 100644 --- a/sources/AppBundle/Controller/Admin/Members/CompanyDeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Members/CompanyDeleteAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class CompanyDeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/CompanyListAction.php b/sources/AppBundle/Controller/Admin/Members/CompanyListAction.php index a42a1948d..c729b273b 100644 --- a/sources/AppBundle/Controller/Admin/Members/CompanyListAction.php +++ b/sources/AppBundle/Controller/Admin/Members/CompanyListAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class CompanyListAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/EditAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/EditAction.php index 6306aef43..540edff95 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/EditAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/EditAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class EditAction extends AbstractController { public function __construct(private readonly AssembleeGeneraleRepository $assembleGeneraleRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ListAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ListAction.php index cb96a4d02..34362e28f 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ListAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ListAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\Response; use Twig\Environment; use Webmozart\Assert\Assert; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class ListAction { public const array VALID_SORTS = ['nom', 'date_consultation', 'presence', 'personnes_avec_pouvoir_nom']; diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ListingAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ListingAction.php index f5fc20b6e..f7ba104cd 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ListingAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ListingAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Webmozart\Assert\Assert; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class ListingAction { public function __construct(private readonly PresenceRepository $presenceRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/PrepareAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/PrepareAction.php index 42d077304..73130443c 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/PrepareAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/PrepareAction.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class PrepareAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ReportsAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ReportsAction.php index f4e8112b5..78e0e0687 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ReportsAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ReportsAction.php @@ -14,7 +14,9 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Validator\Constraints\File; use Symfony\Component\Validator\Constraints\NotBlank; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class ReportsAction extends AbstractController { public function __invoke(Request $request): Response diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php index 948b831e0..48b22785c 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class AddAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/DeleteAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/DeleteAction.php index eb090d558..27fab6bae 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/DeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/DeleteAction.php @@ -8,7 +8,9 @@ use AppBundle\AssembleeGenerale\Entity\Repository\VoteRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class DeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/EditAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/EditAction.php index 83903fb6a..2d7ae2728 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/EditAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/EditAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class EditAction extends AbstractController { public function __construct(private readonly QuestionRepository $questionRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/CloseAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/CloseAction.php index 72d7bb137..2d9ccb4ec 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/CloseAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/CloseAction.php @@ -8,7 +8,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class CloseAction extends AbstractController { public function __construct(private readonly QuestionRepository $questionRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/ListAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/ListAction.php index dd7646173..3d3e3a341 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/ListAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/ListAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class ListAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/OpenAction.php b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/OpenAction.php index adbd02655..48f2c4c74 100644 --- a/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/OpenAction.php +++ b/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/OpenAction.php @@ -8,7 +8,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class OpenAction extends AbstractController { public function __construct(private readonly QuestionRepository $questionRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Members/UserAddAction.php b/sources/AppBundle/Controller/Admin/Members/UserAddAction.php index 17a5cb6a6..a786f723a 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserAddAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserAddAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class UserAddAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/UserBadgeDeleteAction.php b/sources/AppBundle/Controller/Admin/Members/UserBadgeDeleteAction.php index 13fe0d1f2..1eb1ca60f 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserBadgeDeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserBadgeDeleteAction.php @@ -7,7 +7,9 @@ use AppBundle\Event\Entity\Repository\UserBadgeRepository; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class UserBadgeDeleteAction { public function __construct(private readonly UserBadgeRepository $userBadgeRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Members/UserBadgeNewAction.php b/sources/AppBundle/Controller/Admin/Members/UserBadgeNewAction.php index 3fcd3c732..13b570c31 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserBadgeNewAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserBadgeNewAction.php @@ -11,7 +11,9 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class UserBadgeNewAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/UserDeleteAction.php b/sources/AppBundle/Controller/Admin/Members/UserDeleteAction.php index b84c3615a..6928ece74 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserDeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserDeleteAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class UserDeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/UserEditAction.php b/sources/AppBundle/Controller/Admin/Members/UserEditAction.php index 73a28cc87..70f1cb37a 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserEditAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserEditAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class UserEditAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/UserExportAction.php b/sources/AppBundle/Controller/Admin/Members/UserExportAction.php index c30216dba..f4ddb550d 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserExportAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserExportAction.php @@ -9,7 +9,9 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\ResponseHeaderBag; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class UserExportAction { public function __construct(private readonly UserRepository $userRepository) {} diff --git a/sources/AppBundle/Controller/Admin/Members/UserListAction.php b/sources/AppBundle/Controller/Admin/Members/UserListAction.php index 045eef848..06af4636d 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserListAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserListAction.php @@ -9,7 +9,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class UserListAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/UserResetPasswordAction.php b/sources/AppBundle/Controller/Admin/Members/UserResetPasswordAction.php index e62a1370a..529c2dba1 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserResetPasswordAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserResetPasswordAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class UserResetPasswordAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Members/UserSendWelcomeAction.php b/sources/AppBundle/Controller/Admin/Members/UserSendWelcomeAction.php index 63119c55d..72fe2db21 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserSendWelcomeAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserSendWelcomeAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_WRITER')] class UserSendWelcomeAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Membership/ReminderLogAction.php b/sources/AppBundle/Controller/Admin/Membership/ReminderLogAction.php index 4206a5b88..a0d73447d 100644 --- a/sources/AppBundle/Controller/Admin/Membership/ReminderLogAction.php +++ b/sources/AppBundle/Controller/Admin/Membership/ReminderLogAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class ReminderLogAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Planete/FeedAddAction.php b/sources/AppBundle/Controller/Admin/Planete/FeedAddAction.php index a09813f27..f504324b3 100644 --- a/sources/AppBundle/Controller/Admin/Planete/FeedAddAction.php +++ b/sources/AppBundle/Controller/Admin/Planete/FeedAddAction.php @@ -13,7 +13,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_PLANETE_WRITER')] class FeedAddAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Planete/FeedArticleListAction.php b/sources/AppBundle/Controller/Admin/Planete/FeedArticleListAction.php index 82799b7c7..b927c2ae6 100644 --- a/sources/AppBundle/Controller/Admin/Planete/FeedArticleListAction.php +++ b/sources/AppBundle/Controller/Admin/Planete/FeedArticleListAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_PLANETE_READER')] final readonly class FeedArticleListAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Planete/FeedDeleteAction.php b/sources/AppBundle/Controller/Admin/Planete/FeedDeleteAction.php index 34bc93fd7..e9563d08e 100644 --- a/sources/AppBundle/Controller/Admin/Planete/FeedDeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Planete/FeedDeleteAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_PLANETE_WRITER')] class FeedDeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Planete/FeedEditAction.php b/sources/AppBundle/Controller/Admin/Planete/FeedEditAction.php index 7e17c9920..11fce7a3b 100644 --- a/sources/AppBundle/Controller/Admin/Planete/FeedEditAction.php +++ b/sources/AppBundle/Controller/Admin/Planete/FeedEditAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_PLANETE_WRITER')] class FeedEditAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Planete/FeedListAction.php b/sources/AppBundle/Controller/Admin/Planete/FeedListAction.php index 6efc79802..1758fcaa2 100644 --- a/sources/AppBundle/Controller/Admin/Planete/FeedListAction.php +++ b/sources/AppBundle/Controller/Admin/Planete/FeedListAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_PLANETE_READER')] final readonly class FeedListAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/AddRubriqueAction.php b/sources/AppBundle/Controller/Admin/Site/AddRubriqueAction.php index 3a3948bbf..ecd1a10a5 100644 --- a/sources/AppBundle/Controller/Admin/Site/AddRubriqueAction.php +++ b/sources/AppBundle/Controller/Admin/Site/AddRubriqueAction.php @@ -12,7 +12,9 @@ use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_WRITER')] final class AddRubriqueAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/Article/AddArticleAction.php b/sources/AppBundle/Controller/Admin/Site/Article/AddArticleAction.php index f8b85423e..3a0cda7fa 100644 --- a/sources/AppBundle/Controller/Admin/Site/Article/AddArticleAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Article/AddArticleAction.php @@ -14,7 +14,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\String\Slugger\AsciiSlugger; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_WRITER')] final class AddArticleAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/Article/DeleteArticleAction.php b/sources/AppBundle/Controller/Admin/Site/Article/DeleteArticleAction.php index b44ee6769..015e0fd45 100644 --- a/sources/AppBundle/Controller/Admin/Site/Article/DeleteArticleAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Article/DeleteArticleAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_WRITER')] class DeleteArticleAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/Article/EditArticleAction.php b/sources/AppBundle/Controller/Admin/Site/Article/EditArticleAction.php index bea39e15e..ee9fc9f9c 100644 --- a/sources/AppBundle/Controller/Admin/Site/Article/EditArticleAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Article/EditArticleAction.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_WRITER')] final class EditArticleAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/Article/ListArticlesAction.php b/sources/AppBundle/Controller/Admin/Site/Article/ListArticlesAction.php index f8248cf8b..25115cebd 100644 --- a/sources/AppBundle/Controller/Admin/Site/Article/ListArticlesAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Article/ListArticlesAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_READER')] final readonly class ListArticlesAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/DeleteRubriqueAction.php b/sources/AppBundle/Controller/Admin/Site/DeleteRubriqueAction.php index 18cc57d4b..365888ff6 100644 --- a/sources/AppBundle/Controller/Admin/Site/DeleteRubriqueAction.php +++ b/sources/AppBundle/Controller/Admin/Site/DeleteRubriqueAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_WRITER')] class DeleteRubriqueAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/EditRubriqueAction.php b/sources/AppBundle/Controller/Admin/Site/EditRubriqueAction.php index d7ff6089e..7777d946f 100644 --- a/sources/AppBundle/Controller/Admin/Site/EditRubriqueAction.php +++ b/sources/AppBundle/Controller/Admin/Site/EditRubriqueAction.php @@ -11,7 +11,9 @@ use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_WRITER')] final class EditRubriqueAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/Feuille/AddFeuilleAction.php b/sources/AppBundle/Controller/Admin/Site/Feuille/AddFeuilleAction.php index d5772b108..ac1d3c01c 100644 --- a/sources/AppBundle/Controller/Admin/Site/Feuille/AddFeuilleAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Feuille/AddFeuilleAction.php @@ -13,7 +13,9 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_WRITER')] final class AddFeuilleAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/Feuille/DeleteFeuilleAction.php b/sources/AppBundle/Controller/Admin/Site/Feuille/DeleteFeuilleAction.php index fd43ae1b7..651681b04 100644 --- a/sources/AppBundle/Controller/Admin/Site/Feuille/DeleteFeuilleAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Feuille/DeleteFeuilleAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_WRITER')] final class DeleteFeuilleAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/Feuille/EditFeuilleAction.php b/sources/AppBundle/Controller/Admin/Site/Feuille/EditFeuilleAction.php index 9eabcedb3..59c0abcd4 100644 --- a/sources/AppBundle/Controller/Admin/Site/Feuille/EditFeuilleAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Feuille/EditFeuilleAction.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_WRITER')] final class EditFeuilleAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/Feuille/ListFeuillesAction.php b/sources/AppBundle/Controller/Admin/Site/Feuille/ListFeuillesAction.php index bc2f3de3d..48e6345fe 100644 --- a/sources/AppBundle/Controller/Admin/Site/Feuille/ListFeuillesAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Feuille/ListFeuillesAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_READER')] final readonly class ListFeuillesAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Site/ListRubriquesAction.php b/sources/AppBundle/Controller/Admin/Site/ListRubriquesAction.php index 4b36d4a51..0a53aa9e1 100644 --- a/sources/AppBundle/Controller/Admin/Site/ListRubriquesAction.php +++ b/sources/AppBundle/Controller/Admin/Site/ListRubriquesAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SITE_READER')] class ListRubriquesAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/SlackMembers/CheckMembersAction.php b/sources/AppBundle/Controller/Admin/SlackMembers/CheckMembersAction.php index 33ca08645..dca0fc8ae 100644 --- a/sources/AppBundle/Controller/Admin/SlackMembers/CheckMembersAction.php +++ b/sources/AppBundle/Controller/Admin/SlackMembers/CheckMembersAction.php @@ -7,7 +7,9 @@ use AppBundle\Slack\UsersChecker; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class CheckMembersAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Speaker/ExportAction.php b/sources/AppBundle/Controller/Admin/Speaker/ExportAction.php index 614149e4f..d99c96f93 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/ExportAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/ExportAction.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Webmozart\Assert\Assert; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class ExportAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerAddAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerAddAction.php index 121e4c933..380bc141d 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerAddAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerAddAction.php @@ -15,7 +15,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Webmozart\Assert\Assert; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class SpeakerAddAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerDeleteAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerDeleteAction.php index 099c2e007..d133351a7 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerDeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerDeleteAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class SpeakerDeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php index 7b69a3b03..715891ed7 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php @@ -16,7 +16,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Webmozart\Assert\Assert; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class SpeakerEditAction extends AbstractController { public const int ID_FORUM_PHOTO_STORAGE = 16; diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerLinkGravatarAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerLinkGravatarAction.php index acb495d9a..6cb9f06d2 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerLinkGravatarAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerLinkGravatarAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class SpeakerLinkGravatarAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerListAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerListAction.php index e78dbe529..253853988 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerListAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerListAction.php @@ -14,7 +14,9 @@ use Symfony\Component\HttpFoundation\Response; use Twig\Environment; use Webmozart\Assert\Assert; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] class SpeakerListAction { public const array VALID_SORTS = ['name', 'company']; diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerRegisterAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerRegisterAction.php index 1243da411..79d8553ab 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerRegisterAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerRegisterAction.php @@ -19,7 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class SpeakerRegisterAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/SuperApero/AddAction.php b/sources/AppBundle/Controller/Admin/SuperApero/AddAction.php index 15d1bc07e..4969b53e8 100644 --- a/sources/AppBundle/Controller/Admin/SuperApero/AddAction.php +++ b/sources/AppBundle/Controller/Admin/SuperApero/AddAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_APERO_WRITER')] final class AddAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/SuperApero/DeleteAction.php b/sources/AppBundle/Controller/Admin/SuperApero/DeleteAction.php index bdcbb1cb3..13308a033 100644 --- a/sources/AppBundle/Controller/Admin/SuperApero/DeleteAction.php +++ b/sources/AppBundle/Controller/Admin/SuperApero/DeleteAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_APERO_WRITER')] final class DeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/SuperApero/EditAction.php b/sources/AppBundle/Controller/Admin/SuperApero/EditAction.php index c2836a502..75e8eaf37 100644 --- a/sources/AppBundle/Controller/Admin/SuperApero/EditAction.php +++ b/sources/AppBundle/Controller/Admin/SuperApero/EditAction.php @@ -11,7 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_APERO_WRITER')] final class EditAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/SuperApero/ListAction.php b/sources/AppBundle/Controller/Admin/SuperApero/ListAction.php index 5c790c91a..1bd82c81e 100644 --- a/sources/AppBundle/Controller/Admin/SuperApero/ListAction.php +++ b/sources/AppBundle/Controller/Admin/SuperApero/ListAction.php @@ -9,7 +9,9 @@ use Psr\Clock\ClockInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_APERO_READER')] final class ListAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Talk/AddAction.php b/sources/AppBundle/Controller/Admin/Talk/AddAction.php index dea560324..663bd57f9 100644 --- a/sources/AppBundle/Controller/Admin/Talk/AddAction.php +++ b/sources/AppBundle/Controller/Admin/Talk/AddAction.php @@ -13,7 +13,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class AddAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Talk/DeleteAction.php b/sources/AppBundle/Controller/Admin/Talk/DeleteAction.php index be9e3279f..3122def3b 100644 --- a/sources/AppBundle/Controller/Admin/Talk/DeleteAction.php +++ b/sources/AppBundle/Controller/Admin/Talk/DeleteAction.php @@ -10,7 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class DeleteAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Talk/EditAction.php b/sources/AppBundle/Controller/Admin/Talk/EditAction.php index c07dc0303..985a55efe 100644 --- a/sources/AppBundle/Controller/Admin/Talk/EditAction.php +++ b/sources/AppBundle/Controller/Admin/Talk/EditAction.php @@ -15,7 +15,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class EditAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Talk/ExportAction.php b/sources/AppBundle/Controller/Admin/Talk/ExportAction.php index 625200834..b4e4e10a4 100644 --- a/sources/AppBundle/Controller/Admin/Talk/ExportAction.php +++ b/sources/AppBundle/Controller/Admin/Talk/ExportAction.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\ResponseHeaderBag; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] readonly class ExportAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Talk/ExportJoindInAction.php b/sources/AppBundle/Controller/Admin/Talk/ExportJoindInAction.php index b53c525d3..30c57fd41 100644 --- a/sources/AppBundle/Controller/Admin/Talk/ExportJoindInAction.php +++ b/sources/AppBundle/Controller/Admin/Talk/ExportJoindInAction.php @@ -9,7 +9,9 @@ use SplFileObject; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\ResponseHeaderBag; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] readonly class ExportJoindInAction { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Talk/IndexAction.php b/sources/AppBundle/Controller/Admin/Talk/IndexAction.php index 3f49f87ef..13ab16649 100644 --- a/sources/AppBundle/Controller/Admin/Talk/IndexAction.php +++ b/sources/AppBundle/Controller/Admin/Talk/IndexAction.php @@ -16,7 +16,9 @@ use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_READER')] final class IndexAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/Talk/UpdateIndexationAction.php b/sources/AppBundle/Controller/Admin/Talk/UpdateIndexationAction.php index d35ecb332..81d90da59 100644 --- a/sources/AppBundle/Controller/Admin/Talk/UpdateIndexationAction.php +++ b/sources/AppBundle/Controller/Admin/Talk/UpdateIndexationAction.php @@ -8,7 +8,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_EVENT_WRITER')] class UpdateIndexationAction extends AbstractController { public function __construct(private readonly Runner $runner) {} diff --git a/sources/AppBundle/Controller/Admin/TechLetter/GenerateAction.php b/sources/AppBundle/Controller/Admin/TechLetter/GenerateAction.php index 8730685db..dc846a658 100644 --- a/sources/AppBundle/Controller/Admin/TechLetter/GenerateAction.php +++ b/sources/AppBundle/Controller/Admin/TechLetter/GenerateAction.php @@ -11,7 +11,9 @@ use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_VEILLE_WRITER')] final class GenerateAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/TechLetter/HistoryAction.php b/sources/AppBundle/Controller/Admin/TechLetter/HistoryAction.php index 9d6468c9b..7ccf23683 100644 --- a/sources/AppBundle/Controller/Admin/TechLetter/HistoryAction.php +++ b/sources/AppBundle/Controller/Admin/TechLetter/HistoryAction.php @@ -9,7 +9,9 @@ use AppBundle\Veille\Entity\Repository\EnvoiRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_VEILLE_READER')] final class HistoryAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/TechLetter/IndexAction.php b/sources/AppBundle/Controller/Admin/TechLetter/IndexAction.php index fcf6b2336..b6a139e14 100644 --- a/sources/AppBundle/Controller/Admin/TechLetter/IndexAction.php +++ b/sources/AppBundle/Controller/Admin/TechLetter/IndexAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_VEILLE_READER')] final class IndexAction extends AbstractController { public function __construct(private readonly EnvoiRepository $envoiRepository) {} diff --git a/sources/AppBundle/Controller/Admin/TechLetter/MembersAction.php b/sources/AppBundle/Controller/Admin/TechLetter/MembersAction.php index 2ded7a50a..8b7989335 100644 --- a/sources/AppBundle/Controller/Admin/TechLetter/MembersAction.php +++ b/sources/AppBundle/Controller/Admin/TechLetter/MembersAction.php @@ -7,7 +7,9 @@ use AppBundle\Veille\Entity\Repository\NewsletterInscriptionRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_SUPER_ADMIN')] final class MembersAction extends AbstractController { public function __construct(private readonly NewsletterInscriptionRepository $newsletterInscriptionRepository) {} diff --git a/sources/AppBundle/Controller/Admin/TechLetter/PreviewAction.php b/sources/AppBundle/Controller/Admin/TechLetter/PreviewAction.php index 6eb3addcb..f77729f9f 100644 --- a/sources/AppBundle/Controller/Admin/TechLetter/PreviewAction.php +++ b/sources/AppBundle/Controller/Admin/TechLetter/PreviewAction.php @@ -9,7 +9,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_VEILLE_READER')] final class PreviewAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/Admin/TechLetter/RetrieveDataAction.php b/sources/AppBundle/Controller/Admin/TechLetter/RetrieveDataAction.php index acd4f442f..c313a0aa4 100644 --- a/sources/AppBundle/Controller/Admin/TechLetter/RetrieveDataAction.php +++ b/sources/AppBundle/Controller/Admin/TechLetter/RetrieveDataAction.php @@ -9,7 +9,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_VEILLE_WRITER')] final class RetrieveDataAction extends AbstractController { public function __invoke(Request $request): JsonResponse diff --git a/sources/AppBundle/Controller/Admin/TechLetter/SendTestAction.php b/sources/AppBundle/Controller/Admin/TechLetter/SendTestAction.php index 69f6880a2..84940cb67 100644 --- a/sources/AppBundle/Controller/Admin/TechLetter/SendTestAction.php +++ b/sources/AppBundle/Controller/Admin/TechLetter/SendTestAction.php @@ -13,7 +13,9 @@ use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_VEILLE_WRITER')] final class SendTestAction extends AbstractController { public function __construct( diff --git a/sources/AppBundle/Controller/MembershipAdmin/ReportingAction.php b/sources/AppBundle/Controller/MembershipAdmin/ReportingAction.php index 569aa0a1b..9119c55eb 100644 --- a/sources/AppBundle/Controller/MembershipAdmin/ReportingAction.php +++ b/sources/AppBundle/Controller/MembershipAdmin/ReportingAction.php @@ -8,7 +8,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Twig\Environment; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[IsGranted('ROLE_MEMBRES_READER')] class ReportingAction { public function __construct( diff --git a/sources/AppBundle/Controller/Website/Member/MembersAction.php b/sources/AppBundle/Controller/Website/Member/MembersAction.php index ba6ce43d2..d2727fc7a 100644 --- a/sources/AppBundle/Controller/Website/Member/MembersAction.php +++ b/sources/AppBundle/Controller/Website/Member/MembersAction.php @@ -45,7 +45,7 @@ public function __construct( public function __invoke(Request $request): Response { $id = $request->attributes->get('id'); - if ($id && $this->isGranted('ROLE_SUPER_ADMIN')) { + if ($id && $this->isGranted('ROLE_MEMBRES_WRITER')) { $companyId = $id; } else { $companyId = $this->authentication->getAfupUser()->getCompanyId(); @@ -85,7 +85,7 @@ public function __invoke(Request $request): Response } return $this->redirectToRoute('member_company_members', [ - 'id' => $this->isGranted('ROLE_SUPER_ADMIN') ? $companyId : null, + 'id' => $this->isGranted('ROLE_MEMBRES_WRITER') ? $companyId : null, ]); } diff --git a/sources/AppBundle/StaticAnalysis/Rule/AdminControllerIsGrantedRule.php b/sources/AppBundle/StaticAnalysis/Rule/AdminControllerIsGrantedRule.php new file mode 100644 index 000000000..84ac0c44c --- /dev/null +++ b/sources/AppBundle/StaticAnalysis/Rule/AdminControllerIsGrantedRule.php @@ -0,0 +1,97 @@ + + */ +class AdminControllerIsGrantedRule implements Rule +{ + private const string ADMIN_CONTROLLER_NAMESPACE = 'AppBundle\Controller\Admin'; + + /** Surpropriété utilisée par les tests pour analyser des fixtures dans le namespace des stubs. */ + private string $controllerNamespace; + + public function __construct(?string $controllerNamespace = null) + { + $this->controllerNamespace = $controllerNamespace ?? self::ADMIN_CONTROLLER_NAMESPACE; + } + + public function getNodeType(): string + { + return Class_::class; + } + + public function processNode(Node $node, Scope $scope): array + { + $classFqn = $node->namespacedName?->toString() ?? ''; + if ($classFqn === '' || !str_starts_with($classFqn, $this->controllerNamespace . '\\')) { + return []; + } + + // Enums, traits et interfaces sont d'autres types de nœuds : seules les + // classes non abstraites sont des entry points HTTP. + if ($node->isAbstract()) { + return []; + } + + // Listeners noyau qui vivent dans ce namespace : pas des controllers. + if (str_ends_with($classFqn, 'Listener')) { + return []; + } + + if ($this->hasIsGrantedAttribute($node->attrGroups)) { + return []; + } + + foreach ($node->stmts as $stmt) { + if ($stmt instanceof ClassMethod + && $stmt->name->toString() === '__invoke' + && $this->hasIsGrantedAttribute($stmt->attrGroups) + ) { + return []; + } + } + + return [ + RuleErrorBuilder::message('Controller d\'administration sans attribut #[IsGranted] : ajoutez un rôle de la matrice READ/WRITE (ou ROLE_SUPER_ADMIN) au niveau de la classe ou sur __invoke.') + ->identifier('afup.missingIsGrantedOnAdminController') + ->build(), + ]; + } + + /** @param AttributeGroup[] $attributeGroups */ + private function hasIsGrantedAttribute(array $attributeGroups): bool + { + foreach ($attributeGroups as $attributeGroup) { + foreach ($attributeGroup->attrs as $attribute) { + if ((string) $attribute->name === 'IsGranted' || (string) $attribute->name === IsGranted::class) { + return true; + } + } + } + + return false; + } +} diff --git a/tests/integration/AppBundle/Security/AdminAccessControlTest.php b/tests/integration/AppBundle/Security/AdminAccessControlTest.php new file mode 100644 index 000000000..c61834fff --- /dev/null +++ b/tests/integration/AppBundle/Security/AdminAccessControlTest.php @@ -0,0 +1,292 @@ + 'ROLE_MEMBRES_READER', + 'ROLE_VEILLE_WRITER' => 'ROLE_VEILLE_READER', + 'ROLE_SITE_WRITER' => 'ROLE_SITE_READER', + 'ROLE_APERO_WRITER' => 'ROLE_APERO_READER', + 'ROLE_EVENT_WRITER' => 'ROLE_EVENT_READER', + 'ROLE_COMPTA_WRITER' => 'ROLE_COMPTA_READER', + 'ROLE_AG_WRITER' => 'ROLE_AG_READER', + 'ROLE_PLANETE_WRITER' => 'ROLE_PLANETE_READER', + 'ROLE_ANTENNES_WRITER' => 'ROLE_ANTENNES_READER', + ]; + + private const string MEMBER_ROLE = 'ROLE_MEMBER_EXPIRED'; + + private const array READER_ROLES = [ + 'ROLE_MEMBRES_READER', + 'ROLE_VEILLE_READER', + 'ROLE_SITE_READER', + 'ROLE_APERO_READER', + 'ROLE_EVENT_READER', + 'ROLE_COMPTA_READER', + 'ROLE_AG_READER', + 'ROLE_PLANETE_READER', + 'ROLE_ANTENNES_READER', + ]; + + /** Rôles WRITE légaux en attribut controller (clés de WRITE_TO_READ). */ + private const array WRITER_ROLES = [ + 'ROLE_MEMBRES_WRITER', + 'ROLE_VEILLE_WRITER', + 'ROLE_SITE_WRITER', + 'ROLE_APERO_WRITER', + 'ROLE_EVENT_WRITER', + 'ROLE_COMPTA_WRITER', + 'ROLE_AG_WRITER', + 'ROLE_PLANETE_WRITER', + 'ROLE_ANTENNES_WRITER', + ]; + + /** Entrée console : seule route autorisée à porter #[IsGranted('ROLE_ADMIN')] (marqueur, pas un garde fonctionnel). */ + private const string CONSOLE_ENTRY_ROUTE = 'admin_home'; + + /** Redirections legacy /admin/(login|logout|password) → pages publiques : publiques par design, pas de garde en code. */ + private const array LEGACY_AUTH_ROUTES = ['auth_old_login', 'auth_old_logout', 'auth_old_password']; + + private static ?KernelInterface $sharedKernel = null; + + public static function tearDownAfterClass(): void + { + self::$sharedKernel = null; + static::$kernel = null; + } + + /** @return iterable */ + public static function provideAdminRoutes(): iterable + { + /** @var RouterInterface $router */ + $router = self::sharedContainer()->get('router'); + + foreach ($router->getRouteCollection() as $name => $route) { + if (!str_starts_with($route->getPath(), '/admin')) { + continue; + } + + yield $name => [$name, $route]; + } + } + + #[DataProvider('provideAdminRoutes')] + public function testRouteIsGated(string $routeName, Route $route): void + { + $container = self::sharedContainer(); + /** @var AccessMapInterface $accessMap */ + $accessMap = $container->get('security.access_map'); + /** @var AuthorizationCheckerInterface $checker */ + $checker = $container->get('security.authorization_checker'); + /** @var TokenStorageInterface $tokenStorage */ + $tokenStorage = $container->get('security.token_storage'); + $path = $route->getPath(); + + // ── access_control : la première règle matchée est la règle console. + $request = $this->requestFor($path, $routeName); + [$attributes] = $accessMap->getPatterns($request); + self::assertNotEmpty($attributes, "La route {$routeName} ({$path}) n'est couverte par aucune règle console : elle n'est pas protégée par access_control (attendu : la règle ^/admin)."); + $mapRole = $attributes[0]; + if (in_array($routeName, self::LEGACY_AUTH_ROUTES, true)) { + // Redirections legacy du domaine auth : publiques par design, pas de garde en code. + self::assertSame('PUBLIC_ACCESS', $mapRole, "La route {$routeName} ({$path}) doit rester publique (redirection legacy vers une page d'authentification) ; premier rôle matché : '{$mapRole}'."); + + return; + } + self::assertContains( + $mapRole, + self::CONSOLE_ROLES, + "La route {$routeName} ({$path}) n'est pas couverte par la règle console : le premier rôle matché est '{$mapRole}', attendu ROLE_ADMIN ou ROLE_SUPER_ADMIN.", + ); + + // ── #[IsGranted] : présent sur le controller, et c'est lui le vrai garde. + $controllerRole = $this->controllerIsGrantedRole($route); + self::assertNotNull($controllerRole, "Pas d'attribut #[IsGranted] sur le controller de la route {$routeName} ({$path})."); + if ($routeName === self::CONSOLE_ENTRY_ROUTE) { + self::assertSame( + 'ROLE_ADMIN', + $controllerRole, + "L'entrée console ({$routeName}, {$path}) doit porter le marqueur #[IsGranted('ROLE_ADMIN')] ; valeur '{$controllerRole}' inattendue.", + ); + } else { + self::assertTrue( + in_array($controllerRole, self::READER_ROLES, true) + || in_array($controllerRole, self::WRITER_ROLES, true) + || $controllerRole === 'ROLE_SUPER_ADMIN', + "Attribut #[IsGranted] '{$controllerRole}' interdit sur le controller de la route {$routeName} ({$path}) : la matrice READ/WRITE ou ROLE_SUPER_ADMIN, jamais ROLE_ADMIN seul (cela réouvrirait l'accès aux simples comptes LEVEL_ADMIN).", + ); + } + + // ── La hiérarchie (et elle seule) décide qui franchit l'attribut en code. + $expectedEffects = self::expectedMatrix($mapRole, $controllerRole); + foreach ($expectedEffects as $profile => $expected) { + $granted = $this->checkWithToken($checker, $tokenStorage, $profile, $mapRole, $controllerRole); + self::assertSame( + $expected, + $granted, + "Accès sur {$routeName} ({$path}) : le profil {$profile} doit " . ($expected ? 'passer' : 'être refusé') . ".", + ); + } + $tokenStorage->setToken(null); + } + + /** + * Matrice : profil => accès attendu, tenant compte des deux barrières + * (règle console access_control ET #[IsGranted] controllerRole), WRITE ⇒ READ. + * + * La règle console fait passer tout profil admin et bloque anonyme / + * adhérent expiré ; la discrimination fine (READ/WRITE, SUPER_ADMIN) + * vient de l'attribut en code. + * + * @return array + */ + private static function expectedMatrix(string $mapRole, string $controllerRole): array + { + $matrix = [ + 'anonymous' => false, + 'member (expired)' => false, + ]; + + foreach (self::ADMIN_ROLES as $role) { + $matrix[$role] = self::satisfies($role, $mapRole) && self::satisfies($role, $controllerRole); + } + + return $matrix; + } + + /** + * Le rôle candidat satisfait-il le rôle requis ? Grâce à la hiérarchie : + * READ ⇒ ROLE_ADMIN (marqueur console), WRITE ⇒ READ, SUPER_ADMIN ⇒ tous les READ. + */ + private static function satisfies(string $candidate, string $required): bool + { + if ($candidate === 'ROLE_SUPER_ADMIN') { + // ROLE_SUPER_ADMIN possède la console et tous les READ ; jamais un WRITE. + return $required === 'ROLE_SUPER_ADMIN' + || $required === 'ROLE_ADMIN' + || in_array($required, self::READER_ROLES, true); + } + + if ($required === 'ROLE_ADMIN') { + // Tout rôle fonctionnel (READ/WRITE) implique ROLE_ADMIN ; ROLE_ADMIN seul n'ouvre rien de fonctionnel. + return $candidate === 'ROLE_ADMIN' + || in_array($candidate, self::READER_ROLES, true) + || array_key_exists($candidate, self::WRITE_TO_READ); + } + + return $candidate === $required || (self::WRITE_TO_READ[$candidate] ?? null) === $required; + } + + private function checkWithToken(AuthorizationCheckerInterface $checker, TokenStorageInterface $tokenStorage, string $profile, string $mapRole, string $controllerRole): bool + { + $token = match ($profile) { + 'anonymous' => new UsernamePasswordToken(new InMemoryUser('anon.', null, ['IS_AUTHENTICATED_ANONYMOUSLY']), 'main', ['IS_AUTHENTICATED_ANONYMOUSLY']), + 'member (expired)' => new UsernamePasswordToken(new InMemoryUser('member', null, [self::MEMBER_ROLE]), 'main', [self::MEMBER_ROLE]), + default => new UsernamePasswordToken(new InMemoryUser('u', null, [$profile]), 'main', [$profile]), + }; + $tokenStorage->setToken($token); + + // Les deux barrières doivent être franchies simultanément : + // la règle console access_control ET l'attribut #[IsGranted] du controller. + return $checker->isGranted($mapRole) && $checker->isGranted($controllerRole); + } + + private function controllerIsGrantedRole(Route $route): ?string + { + $controller = $route->getDefault('_controller'); + if (!is_string($controller)) { + return null; + } + + if (str_contains($controller, ':') && !str_contains($controller, '::')) { + return null; // service:method, pas traité ici. + } + + [$class, $method] = array_pad(explode('::', $controller, 2), 2, null); + if (!class_exists($class)) { + return null; + } + + $reflected = new \ReflectionClass($class); + $attribute = $reflected->getAttributes(IsGranted::class)[0] ?? null; + if ($attribute === null && $method !== null) { + $attribute = $reflected->getMethod($method)->getAttributes(IsGranted::class)[0] ?? null; + } + + return $attribute === null ? null : $attribute->newInstance()->attribute; + } + + private function requestFor(string $path, string $routeName): Request + { + $request = Request::create($path); + $request->attributes->set('_route', $routeName); + + return $request; + } + + private static function sharedContainer(): ContainerInterface + { + if (self::$sharedKernel === null) { + self::$sharedKernel = self::createKernel(); + self::$sharedKernel->boot(); + } + + return self::$sharedKernel->getContainer()->get('test.service_container'); + } +} diff --git a/tests/integration/AppBundle/StaticAnalysis/Rule/AdminControllerIsGrantedRuleTest.php b/tests/integration/AppBundle/StaticAnalysis/Rule/AdminControllerIsGrantedRuleTest.php new file mode 100644 index 000000000..c94101c31 --- /dev/null +++ b/tests/integration/AppBundle/StaticAnalysis/Rule/AdminControllerIsGrantedRuleTest.php @@ -0,0 +1,38 @@ + */ +final class AdminControllerIsGrantedRuleTest extends RuleTestCase +{ + protected function getRule(): Rule + { + // Les fixtures vivent dans le namespace autoloadé des stubs. + return new AdminControllerIsGrantedRule('Afup\Tests\Stubs\PHPStan'); + } + + public function testRule(): void + { + $u = __DIR__ . '/../../../../stubs/phpstan'; + + $this->analyse([ + $u . '/ControllerWithoutIsGranted.php', + $u . '/InvokeWithoutIsGranted.php', + ], [ + [ + 'Controller d\'administration sans attribut #[IsGranted] : ajoutez un rôle de la matrice READ/WRITE (ou ROLE_SUPER_ADMIN) au niveau de la classe ou sur __invoke.', + 7, + ], + [ + 'Controller d\'administration sans attribut #[IsGranted] : ajoutez un rôle de la matrice READ/WRITE (ou ROLE_SUPER_ADMIN) au niveau de la classe ou sur __invoke.', + 7, + ], + ]); + } +} diff --git a/tests/stubs/phpstan/ControllerClassLevelIsGranted.php b/tests/stubs/phpstan/ControllerClassLevelIsGranted.php new file mode 100644 index 000000000..5f281c9b4 --- /dev/null +++ b/tests/stubs/phpstan/ControllerClassLevelIsGranted.php @@ -0,0 +1,13 @@ +