Conditionally removing the "configure" editor (#16778)

Note, I'm not overly keen on writing permission tests for this
component.  Why?  Robust permissioning tests can create combinatorial
explosions.  And there are presently no Rspec request specs for this.
So to add an automated test, we'd need to add a set of seed data that
seeds data that conforms to the emerging business logic of the policy.

And while this is easy with use case 1-1, it gets harder as we move
into more nuanced use cases.  Instead we should rely on bombarding our
policy classes with lots of tests to let them demonstrate what we mean
when we say `if p.olicy(Article).create?`

Note, there is a potential relation to forem/forem#14807, namely if we
add a rich text editor to our comments, we may need to explore the
purpose and intention of this setting.

Closes forem/forem#16516
This commit is contained in:
Jeremy Friesen 2022-03-04 12:41:56 -05:00 committed by GitHub
parent 4d612ed525
commit 1d7436702f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,6 +40,7 @@
</div>
</div>
<% if policy(Article).create? %>
<div class="crayons-card crayons-card--content-rows">
<h2 class="crayons-subtitle-1">
<%= t("views.settings.custom.writing") %>
@ -53,6 +54,7 @@
</div>
</div>
</div>
<% end %>
<div class="crayons-card crayons-card--content-rows">
<h2 class="crayons-subtitle-1">