mirror of
https://github.com/discourse/discourse.git
synced 2025-03-29 11:25:41 +08:00

The Guardian object memoizes a list of allowed user fields. Normally this is fine because Guardian objects only persist for a single request. However, the WebHook class was memoizing a guardian at the class level. This meant that an app restart was required for changes to be reflected. Plus, the Guardian was being shared across all sites in a multisite instance. Initializing a guardian is cheap, so we can manage without memoization here.