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 2aadbe44d20e8..2558c3db1e1d0 100644 --- a/decidim-core/app/helpers/concerns/decidim/user_role_checker.rb +++ b/decidim-core/app/helpers/concerns/decidim/user_role_checker.rb @@ -20,12 +20,9 @@ def user_has_any_role?(user, participatory_space = nil) def participatory_process_user_role?(user, participatory_process = nil) return false unless Decidim.module_installed?(:participatory_processes) + return false unless participatory_process.is_a?(Decidim::ParticipatoryProcess) - if participatory_process.is_a?(Decidim::ParticipatoryProcess) - Decidim::ParticipatoryProcessUserRole.exists?(user:, participatory_process:) - else - Decidim::ParticipatoryProcessUserRole.exists?(user:) - end + Decidim::ParticipatoryProcessUserRole.exists?(user:, participatory_process:) end def assembly_user_role?(user, assembly = nil)