From 9ee8c38a177891635e11cc1aa2c889df8466e63d Mon Sep 17 00:00:00 2001 From: Elvia Benedith <116598037+ElviaBth@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:02:47 +0200 Subject: [PATCH] Update decidim-core/app/helpers/concerns/decidim/user_role_checker.rb Co-authored-by: Alexandru Emil Lupu --- .../app/helpers/concerns/decidim/user_role_checker.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/decidim-core/app/helpers/concerns/decidim/user_role_checker.rb b/decidim-core/app/helpers/concerns/decidim/user_role_checker.rb index 9eb836bb9d2ce..d55dd9ea45c2a 100644 --- a/decidim-core/app/helpers/concerns/decidim/user_role_checker.rb +++ b/decidim-core/app/helpers/concerns/decidim/user_role_checker.rb @@ -30,12 +30,9 @@ def participatory_process_user_role?(user, participatory_process = nil) def assembly_user_role?(user, assembly = nil) return false unless Decidim.module_installed?(:assemblies) + return false unless assembly.is_a?(Decidim::Assembly) - if assembly.is_a?(Decidim::Assembly) - Decidim::AssemblyUserRole.exists?(user:, assembly:) - else - Decidim::AssemblyUserRole.exists?(user:) - end + Decidim::AssemblyUserRole.exists?(user:, assembly:) end def conference_user_role?(user, conference = nil)