Problem/Motivation
When making lists of entities in views, and these entities have the vud_field, the voting widget is displayed even if a user is not allowed to vote. The voting permissions are still respected, which leads to dead voting icons and possibly confused users.
Proposed resolution
Do some kind of permissions check and hide the voting widget all together if the user can't vote.
Remaining tasks
Find a solution.
Implement the solution.
Test the solution.
User interface changes
Voting widget will no longer appear in view lists, if the acting user is not allowed to vote.
Comments
Comment #1
itangalo commentedPatch attached.
I am a bit hesitant – would some people like to have the widget visible, even if they can't vote? In that case it *might* make sense to have a "view vote up/down" permission. But the most common case is probably that if you can't vote, you don't want to see the voting widget.
Comment #2
itangalo commentedComment #3
marvil07 commentedYes, that's right. Please notice that the Use Vote Up/Down permission descriptions is Grant users the ability to cast votes, not view.
There is a lot of logic about read only widgets inside the function you modified, so, adding your patch means dropping functionality.
I guess you can achieve this functionality using Field Permissions.
I think I can not reproduce that behavior. Could you please give more details on how to reproduce it.
Comment #4
itangalo commentedI only meant that the actual widget shows – like thumbs up/down – but the user is not able to click the thumbs.
I didn't mean to remove functionality you put efforts into getting to work. What do you think about the approach to add an additional check box in the view field handler, "only show if user has voting permission"?
Comment #5
itangalo commentedI just realized that Vote Up/Down dosn't have it's own views handler (which makes perfect sense, since it's implemented as a field). I thought I was going to create a patch for the new approach, but it will take some more time.
If you have ideas, I'd be happy to listen. (I guess introducing a new permission "view Vote Up/Down widget" is out of the question?)
Comment #6
marvil07 commentedGreat to know is not broken :-)
I would say it would be a good idea to try to see if Field Permissions is enough. If not, I guess I will be open to a feature like that.
Please notice that one of the good sides of finally have a vud as fields is actually use other modules for extra general field features, like permissions.
Comment #7
itangalo commentedI have been thinking that Field Permissions feels like a quite heavy module to enable just to hide a field – it would have to check permissions for every field at every time.
But on second thoughts you are absolutely right. It's much better to rely on the existing solutions – even when they are more generic than you need for a particular case.
marvil07++
Comment #7.0
itangalo commentedCrossed off two of three tasks.