docbrown/spec
Jeremy Friesen 88f4daf952
Penciling in a Default Spaces section (#16897)
* Penciling in a Default Spaces section

This delivers two primary things:

1.  Extracting shared policy examples
2.  Providing a functioning skeleton for toggling on the
    "limit_post_creation_to_admins" feature.

Important is that once merged, it would be possible for this code to
"leak" out.  But how that leaks out is also how you can test that the
feature works.

First, to orient, there is a constraint for a new route.  That
constraint checks if the feature flag exists (e.g. has been explicitly
enabled or explicitly disabled).  In other words, at this point, you
can't accidentally enable the feature via the UI.  But once you have
enabled the feature, you can then toggle the feature on and off.

So, to test this in the browser:

1. Pull down this branch
2. Run `rails runner "FeatureFlag.disable(:limit_post_creation_to_admins)"`
3. Startup your the web server.
4. Login as an administrator
5. Goto /admin/content_manager/spaces
   a. Bask in the glory of a plain HTML form
6. With another browser, login as another non-admin user
7. Go to /settings/extensions, you should see a section Publishing from RSS.
8. Now with the admin's session, update the form to turn on
  "limit_post_creation_to_admins"
9. Back to the non-admin browser, refresh /settings/extensions, you
   should no longer see the section Publishing from RSS.

Note: I have not included an admin menu item as that is related to and
dependent on some refactors I'm working on (see forem/forem#16888 and
forem/forem#16847).  So a bit of "security through obsurity"

Note: In the future, once we resolve forem/forem#16490, we'll start
toggling the "Create a Post" button.

Note: I am not including Cypress tests nor request tests for this
feature because the implementation details related to the testing via
that approach are a little too volitale.

Related to forem/forem#16842

* Updating copy based on forem/forem#16893

* styles

* styles

* dark styles

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
2022-03-21 09:56:12 -04:00
..
controllers/concerns 15 minute fix: Add default argument to JsonApiSortParam (#13369) 2021-04-14 10:32:07 +07:00
decorators Routine Rubocop fixes (#16838) 2022-03-09 09:32:50 -05:00
factories Require profile fields to belong to a group (#16390) 2022-02-15 09:27:18 -06:00
fixtures Remove duplicated work display from header / profile work (#14210) 2021-07-30 12:28:40 +02:00
forms Routine Rubocop fixes (#16838) 2022-03-09 09:32:50 -05:00
generator Add service generator (#11265) 2020-11-10 09:09:35 +07:00
helpers Routine Rubocop fixes (#16838) 2022-03-09 09:32:50 -05:00
initializers A suspended user returns 403 instead of 500 (#16408) 2022-02-04 09:42:23 -05:00
lib Remove fastly http purge feature flag and conditional behavior (#16903) 2022-03-18 09:10:43 -05:00
liquid_tags Fix embed link validation failures (#16920) 2022-03-18 14:45:43 -04:00
mailers "Reply to" and "From" Email addresses for SMTP Configurations (#16499) 2022-02-16 16:14:54 +02:00
models Penciling in a Default Spaces section (#16897) 2022-03-21 09:56:12 -04:00
policies Penciling in a Default Spaces section (#16897) 2022-03-21 09:56:12 -04: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 Introduce "extensions" (#16840) 2022-03-18 11:22:17 +02:00
routing Scoping the :listing routes to feature (#16406) 2022-02-04 10:13:56 -05:00
sanitizers Don't sanitize anchor elements with no href (#16667) 2022-02-22 11:27:38 -06:00
serializers Refactoring to add helper method (#16064) 2022-01-12 11:21:44 -05:00
services Add Errno::EHOSTUNREACH to Podcasts's rescue list (#16884) 2022-03-15 14:05:04 -04:00
support Fix embed link validation failures (#16920) 2022-03-18 14:45:43 -04:00
system Remove admin_member_view Feature Flag-Related Conditionals (#16764) 2022-03-10 08:29:05 -07:00
tasks Make home link an admin-customisable navigation link (#16268) 2022-02-01 09:27:09 +00:00
uploaders Remove Remaining logo_svg Code (#16291) 2022-02-22 12:05:16 -07: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 Limit per-user feed import fanout to users with feed urls set (#16831) 2022-03-09 08:51:00 -06:00
i18n_spec.rb Show missing translation keys when test fails (#16637) 2022-02-17 16:21:29 -06:00
rails_helper.rb Penciling in a Default Spaces section (#16897) 2022-03-21 09:56:12 -04:00
spec_helper.rb Theme data update script, remove theme choices from UI (#15225) 2021-11-08 08:38:43 -05:00