0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-07 13:19:19 +08:00
discourse/plugins/discourse-calendar/spec/lib
Martin Brennan 57779cc4be
FIX: can_create_discourse_post_event? not checking user groups correctly (#42284)
This commit fixes `can_create_discourse_post_event?` manually checking
a user's groups, which doesn't account for pseudogroups like
`logged_in_users`. We should always use `user.in_any_groups?` for this.

In addition, the opportunity is taken here for some cleanup, moving
all the guardian extensions from plugin.rb into a proper
`GuardianExtensions` file for calendar, adding extra specs along the
way.

Finally, I've added a `Group.refresh_automatic_groups_for_user!`
method as a single-user variant of `Group.refresh_automatic_groups!`
that can use in fabricators for testing, to make this more
thorough/reliable
than manually adding group user records in `after_create` in the
fabricators
2026-08-04 16:09:50 +10:00
..
discourse_calendar/livestream UX: improve livestream chat messaging (#41750) 2026-07-21 11:07:31 +10:00
discourse_post_event FIX: can_create_discourse_post_event? not checking user groups correctly (#42284) 2026-08-04 16:09:50 +10:00
calendar_custom_fields_validator_spec.rb FIX: Support uppercase and separators in event custom field names (#40995) 2026-06-24 17:02:32 +02:00
calendar_first_day_of_week_spec.rb DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
calendar_settings_validator_spec.rb
calendar_spec.rb
group_timezones_spec.rb
users_on_holiday_spec.rb