docbrown/app
Jeremy Friesen d1069af35c
Adding ArticlePolicy#moderate? (#16786)
This commit does three things:

1) Adds and tests the ArticlePolicy#moderate? feature
2) Refactors the spec helpers to be a bit more flexible
3) Adds a few more edge case tests around ArticlePolicy

My apologies for conflating these changes, as it makes this commit
more challenging to review.

The goal is to adequate demonstrate the logic around users who can or
cannot moderate.  At present, the rules for who can moderate is here:

841491c6ee/app/javascript/packs/articleModerationTools.js (L17-L27)

```js
if (user?.trusted) {
   if (user?.id !== articleAuthorId && !isModerationPage()) {
     initializeActionsPanel(user, path);
     initializeFlagUserModal(articleAuthorId);
     // "/mod" page
   } else if (isModerationPage()) {
     initializeActionsPanel(user, path);
     initializeFlagUserModal(articleAuthorId);
   }
}
```

- Related to forem/forem#16783
- Closes forem/forem#16784
2022-03-07 15:27:43 -05:00
..
assets Prevent hidden link skewing layout of home page (#16773) 2022-03-04 16:12:35 +00:00
controllers Removing before_action in favor of explicity call (#16777) 2022-03-04 11:08:53 -05:00
decorators [Small win] Add display name to campaign settings (#16653) 2022-02-22 10:01:52 -05:00
errors A suspended user returns 403 instead of 500 (#16408) 2022-02-04 09:42:23 -05:00
forms Using a Form Object that will persist for the Creator Settings Form (#15684) 2021-12-10 17:07:40 +02:00
helpers Removing bootstrap: admin sidebar navigation (#16618) 2022-03-01 15:46:45 +01:00
javascript Use the Preact ColorPicker in creator onboarding (#16731) 2022-03-03 08:22:10 +00:00
lib Renaming method for clarity (#16791) 2022-03-07 12:55:56 -05:00
liquid_tags Implement Loom Embed (not merging now) (#16633) 2022-02-22 09:05:55 -05:00
mailers "Reply to" and "From" Email addresses for SMTP Configurations (#16499) 2022-02-16 16:14:54 +02:00
models Renaming method for clarity (#16791) 2022-03-07 12:55:56 -05:00
policies Adding ArticlePolicy#moderate? (#16786) 2022-03-07 15:27:43 -05:00
queries small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
refinements Drop profile columns from user (#10707) 2020-12-03 08:14:38 +07:00
sanitizers Don't sanitize anchor elements with no href (#16667) 2022-02-22 11:27:38 -06:00
serializers Remove unused methods from User (#16616) 2022-02-18 09:02:17 +07:00
services Only fetch RSS of users who can create articles (#16766) 2022-03-04 14:06:38 -05:00
uploaders small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
validators Remove the "Getting Started" Section from the Config (#16033) 2022-01-20 07:31:35 -07:00
view_objects Patching ERB rendering of the data-info JSON (#16067) 2022-01-14 08:30:49 -05:00
views Conditionally rendering RSS feed settings (#16790) 2022-03-07 12:56:54 -05:00
workers Favoring User scope as parameter for feed fetching (#16763) 2022-03-02 16:45:06 -05:00