0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-10 23:59:31 +08:00
discourse/plugins/discourse-calendar/lib/discourse_post_event
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
..
email_renderer.rb FIX: Cook event location and description as inline markdown (#41994) 2026-07-28 18:59:23 +02:00
engine.rb
event_excerpt.rb FIX: Cook event location and description as inline markdown (#41994) 2026-07-28 18:59:23 +02:00
event_finder.rb SECURITY: Remove stale invitee access for users removed from invited groups on private events (#42187) 2026-07-30 15:15:46 -05:00
event_onebox_data.rb FEATURE: render links to event topics as interactive cards (#40953) 2026-07-17 10:36:54 -04:00
event_parser.rb FIX: Cook event location and description as inline markdown (#41994) 2026-07-28 18:59:23 +02:00
event_validator.rb FIX: can_create_discourse_post_event? not checking user groups correctly (#42284) 2026-08-04 16:09:50 +10:00
export_csv_controller_extension.rb
export_csv_file_extension.rb FIX: can_create_discourse_post_event? not checking user groups correctly (#42284) 2026-08-04 16:09:50 +10:00
guardian_extensions.rb FIX: can_create_discourse_post_event? not checking user groups correctly (#42284) 2026-08-04 16:09:50 +10:00
post_extension.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
rrule_configurator.rb FEATURE: simplifed event creation in the composer (#39835) 2026-05-26 15:04:05 -04:00
rrule_generator.rb
topic_extension.rb FIX: Topic Merging with Events (#41369) 2026-07-02 13:30:34 -05:00
web_hook_extension.rb FEAT: add images to post event events (#38643) 2026-04-13 09:45:06 -05:00