Skip to content

fix voting access for restricted users - #2116

Open
cellio wants to merge 3 commits into
developfrom
cellio/2114-missing-vote-restriction
Open

fix voting access for restricted users#2116
cellio wants to merge 3 commits into
developfrom
cellio/2114-missing-vote-restriction

Conversation

@cellio

@cellio cellio commented Jul 28, 2026

Copy link
Copy Markdown
Member

Fixes #2114. After checking for trying to vote on your own post, the votes controller now also checks if you are missing the "unrestricted" ability and this isn't an answer to your question. It's important that this is the second check, because we're calling owns_post_or_parent? instead of writing a new very similar check. If it's your post we've already bailed, so this is really just checking whether you own the parent.

I tested this manually with restricted and unrestricted users voting on their own posts, answers to their questions, and unrelated posts. I also pre-emptively ran rubocop before committing, so I'm not sure what's up with that test failure here.

@cellio
cellio requested a review from a team July 28, 2026 23:13
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.94%. Comparing base (3966e46) to head (ed002f4).

Files with missing lines Patch % Lines
app/controllers/votes_controller.rb 75.00% 1 Missing ⚠️
Additional details and impacted files
Components Coverage Δ
controllers 76.75% <75.00%> (-0.05%) ⬇️
helpers 85.47% <ø> (ø)
jobs 77.43% <ø> (ø)
models 93.14% <ø> (ø)
tasks 61.11% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Users without Participate Everywhere can still vote freely

1 participant