- 🇳🇬Nigeria chike Nigeria
Using Fivestar in Drupal 10 now and I am still struggling to stop anonymous users from voting. I want only a custom user role to be able to vote.
Is this available in the module yet?
- 🇳🇬Nigeria chike Nigeria
There is a 'rate_content' permission but even thought I set it to allow only one role to be able to rate users (I have fivestar on user accounts not content), anonymous users and every other user roles are still able to rate users. I am not sure if the problem is that I have fivestar on user accounts and not nodes (content). I have not tried if the permission works for nodes.
- 🇺🇸United States tr Cascadia
@chike: The "rate content" permission has not been fully ported from Drupal 7 yet. Please contribute to 🐛 Rate content permission is not ported to D8 Needs work
- First commit to issue fork.
- last update
about 1 year ago 4 pass - @souvik_banerjee opened merge request.
- 🇮🇳India souvik_banerjee
Hi, I have added code so that anonymous users are redirected to the login page when they try to cast their vote.
- Status changed to Needs review
about 1 year ago 10:56am 28 September 2023 - Status changed to Needs work
about 1 year ago 2:36am 1 October 2023 - 🇺🇸United States tr Cascadia
I don't think #7 is usable as-is.
First, it ALWAYS redirects anonymous users to the login page, whether or not anonymous users have the "rate content" permission.
Second, you don't add any configuration options to enable/disable this feature. Not everyone will want this, and your default values change the behavior of this module for existing sites.
Third, if this is done, it should work with the permission, and as stated above the permission does not work yet in the 8.x-1.x branch. This is the first thing that needs to be fixed, with a test case to demonstrate it works and to prevent it from being broken in the future.
I personally think that redirects like this should not be done in this module. This use case of redirect to somewhere if the permission is not present is very common for many applications. Hardwiring it to the Fivestar module without configuration options is a very limited use case, and it does nothing to address all the other use cases - in essence you would have to re-create this feature for every contributed module which wanted anonymous users to log in before doing something. See for example https://www.drupal.org/node/60148 → and https://www.drupal.org/project/r4032login →
- 🇺🇸United States tr Cascadia
New features should go into the latest version of Fivestar first.