impactoss / impactoss-server

IMPACT OSS - server-side application & API
https://demo.impactoss.org
MIT License
3 stars 8 forks source link

Limit access to archived content like with drafts #413

Closed lukearndt closed 2 months ago

lukearndt commented 2 months ago

Context

https://github.com/impactoss/impactoss-server/issues/409

We want archived content to only be visible to authenticated users with the admin, manager, or contributor roles.

Changes

This commit limits access to archived content in the same way that we currently do for draft content.

It also updates our controller tests to account for the new restriction, making them more robust in the process.

Considerations

Along the way, I found it helpful to change the RSpec setting that limits the maximum formatted output length for any given test failure. The default value was quite low, and RSpec truncated away a lot of vital information when using the match_array matcher. I've included that change in this commit.

tmfrnz commented 2 months ago

Along the way, I found it helpful to change the RSpec setting that limits the maximum formatted output length for any given test failure. The default value was quite low, and RSpec truncated away a lot of vital information when using the match_array matcher. I've included that change in this commit.

Awesome!