Skip to content

Commit

Permalink
add method moderator? in user extend model
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbaraOliveira13 committed Feb 13, 2025
1 parent bbf4025 commit 981e540
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/extends/models/decidim/user_extends.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ def needs_password_update?

password_updated_at < Decidim.config.admin_password_expiration_days.days.ago
end

def moderator?
Decidim.participatory_space_manifests.map do |manifest|
participatory_space_type = manifest.model_class_name.constantize
return true if participatory_space_type.moderators(organization).exists?(id)
end
false
end
end
end

Expand Down

0 comments on commit 981e540

Please sign in to comment.