docbrown/app/policies
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
..
admin_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
api_secret_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
application_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
article_policy.rb Removing Articles::Builder making policy decision (#16536) 2022-02-14 11:39:22 -05:00
authorizer.rb Removing deprecated User methods (#16435) 2022-02-07 10:32:58 -05:00
comment_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
consumer_app_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
discussion_lock_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
follow_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
github_repo_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
html_variant_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
image_upload_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
internal_policy.rb Refactoring questions asked of user (#15762) 2021-12-21 12:45:12 -05:00
liquid_tag_policy.rb small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
listing_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
message_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
organization_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
pinned_article_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
rating_vote_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
reaction_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
registration_policy.rb Refactor RegistrationsController (#13903) 2021-06-08 17:03:41 -04:00
response_template_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
stripe_active_card_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
stripe_subscription_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
tag_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
user_block_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
user_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
video_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00