docbrown/spec
Jeremy Friesen cf53758476
Removing Articles::Builder making policy decision (#16536)
* Removing Articles::Builder making policy decision

This change is a refactoring through triangulation.  Given that
`ArticlePolicy#new?` returned true, I'm prepared to assume that calling
`authorize(Article)` in all cases is acceptable.

So to narrow the Builder making a policy decision I renamed the returned
value to reflect what it was actually doing in the logic.  And in
renaming, flipped the polarity of the boolean.  Why the flip?  Because
`needs_authorization == !store_location`.

In consultation with Allison and Jennie, I'm proceeding with a short-cut
to get me unstuck.  That unstuck is namely "I need to ensure that the
articles#new action can go through authorization."

Given that I'll be spending time in the authorization layer, I hope
these noted short-cuts and comments will be useful in future spelunking
efforts regarding authorization.

Closes #16529

* Update app/policies/article_policy.rb

Co-authored-by: Michael Kohl <me@citizen428.net>

* Disabling spec

* Update app/policies/article_policy.rb

Co-authored-by: Dwight Scott <dwight@forem.com>

* Update app/policies/article_policy.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: Dwight Scott <dwight@forem.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-14 11:39:22 -05:00
..
controllers/concerns 15 minute fix: Add default argument to JsonApiSortParam (#13369) 2021-04-14 10:32:07 +07:00
decorators Refactoring cached_followed_tags (#16175) 2022-01-24 19:53:48 -05:00
factories Add boolean attribute main_image_from_frontmatter to indicate if cove… (#16075) 2022-02-03 09:16:48 -05:00
fixtures Remove duplicated work display from header / profile work (#14210) 2021-07-30 12:28:40 +02:00
forms Clear changes to settings after checking form saves them (#15746) 2021-12-14 08:39:14 -06:00
generator Add service generator (#11265) 2020-11-10 09:09:35 +07:00
helpers Adding conditional rendering of navigation links (#16362) 2022-02-01 12:23:58 -05:00
initializers A suspended user returns 403 instead of 500 (#16408) 2022-02-04 09:42:23 -05:00
lib Short-circuiting parsing any articles to update (#16413) 2022-02-04 11:13:01 -05:00
liquid_tags Allowing dependency injection for LiquidTag policy (#16511) 2022-02-10 07:47:16 -05:00
mailers Prefer custom SMTP config over Sendgrid (#16216) 2022-01-24 14:11:50 -05:00
models Implement Unified Embeds for Github Repo, Issue, Pull-Request and Comment URLs (#16422) 2022-02-07 16:38:43 -05:00
policies Removing Articles::Builder making policy decision (#16536) 2022-02-14 11:39:22 -05:00
queries Fixes a name conflict in Rpush models (#15978) 2022-01-07 09:38:16 -06:00
refinements Update data exporter to handle admin send (#10274) 2020-10-26 18:00:56 -04:00
requests Removing Articles::Builder making policy decision (#16536) 2022-02-14 11:39:22 -05:00
routing Scoping the :listing routes to feature (#16406) 2022-02-04 10:13:56 -05:00
serializers Refactoring to add helper method (#16064) 2022-01-12 11:21:44 -05:00
services Removing Articles::Builder making policy decision (#16536) 2022-02-14 11:39:22 -05:00
support Added E2E tests for new admin member details view (#16513) 2022-02-11 08:47:01 -05:00
system Now Bg color hex is labeled Tag Color (#16492) 2022-02-11 08:31:57 -05:00
tasks Make home link an admin-customisable navigation link (#16268) 2022-02-01 09:27:09 +00:00
uploaders Data Update Script to migrate logo_svg contents to png file (Will be merged and deployed on 10/01) (#15710) 2022-01-10 16:09:34 +02:00
validators Don't raise error when empty community emoji setting submitted (#15723) 2021-12-17 09:29:55 -06:00
view_objects Patching ERB rendering of the data-info JSON (#16067) 2022-01-14 08:30:49 -05:00
views quote localized strings in credits/purchase embedded script (#15623) 2021-12-01 10:07:55 -06:00
workers Ensure arguments to perform_async are json safe (#16285) 2022-01-25 18:07:40 -06:00
i18n_spec.rb Misc i18n fixes (#14852) 2021-10-05 13:22:33 +02:00
rails_helper.rb Let's be friends again, Rubocop (#16294) 2022-01-25 11:58:00 -05:00
spec_helper.rb Theme data update script, remove theme choices from UI (#15225) 2021-11-08 08:38:43 -05:00