Sprankelprachtig aan/afmeldsysteem

groups_helper.rb 503B

1234567891011121314151617181920
  1. module GroupsHelper
  2. def require_membership!
  3. return unless require_login!
  4. return if @group.member?(current_person) || current_person.is_admin?
  5. flash_message(:danger, I18n.t('groups.membership_required'))
  6. redirect_to dashboard_home_path
  7. end
  8. def require_leader!
  9. return unless require_login!
  10. return if @group.leader?(current_person) || current_person.is_admin?
  11. flash_message(:danger, I18n.t('groups.leadership_required'))
  12. redirect_to dashboard_home_path
  13. end
  14. end