Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new option to hide voting when not allowed #112

Closed
wants to merge 13 commits into from
Closed

Add new option to hide voting when not allowed #112

wants to merge 13 commits into from

Conversation

hackerESQ
Copy link

Fixes #32 and somewhat related to v17development/flarum-support-feedback#14

Changes proposed in this pull request:
This adds a new option in extension settings that allows admins to hide voting options when the post/tag/user does not have permissions to vote.

Reviewers should focus on:
This only adds a new configuration option. But perhaps the logic to hide should be reviewed:

if (setting('hideIfNoPermissions', true) && !post.canVote() && !post.canSeeVotes()) {
   return;
}

This same logic was added to the alternate layout as well.

Screenshot
image

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

Required changes:
N/A

@hackerESQ hackerESQ closed this by deleting the head repository Dec 5, 2023
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.

Tag-based voting / permission bug?
1 participant