mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 13:08:40 +08:00
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 |
||
|---|---|---|
| .. | ||
| discourse_calendar | ||
| discourse_post_event | ||
| tasks | ||
| calendar.rb | ||
| calendar_custom_fields_validator.rb | ||
| calendar_first_day_of_week.rb | ||
| calendar_settings_validator.rb | ||
| calendar_upcoming_events_default_view.rb | ||
| calendar_validator.rb | ||
| event_validator.rb | ||
| group_timezones.rb | ||
| holiday_status.rb | ||
| time_sniffer.rb | ||
| users_on_holiday.rb | ||