Since feature request #554360: Disallow Voting on Your Own Content has been closed as a won't-fix, I am starting this as a support request...

Is this even possible? If yes, then how does one achieve this? What steps/patches/workarounds/other modules are required for this task?

Update: We are waiting for #877392: Add hook that allows modules to alter voting permissions (committed to 6.x-3.x - port to 7.x pending). Note that fixing that issue doesn't directly provide the feature we are after here (maintainer feels that this is out of the project's scope). It simply provides the means for other people/modules to come up with a solution.

CommentFileSizeAuthor
#11 2014-11-30_123612.jpg112.83 KBkaztur
#2 vud_hide_widget_0.patch11.6 KBdrnikki

Comments

welly’s picture

If you're handy with templating, this should be quite simple to do.

In the voteupdown administration (this is for comment voting - should work with node voting too), you can set the widget display to not append to comments and that you'll manually insert $comment->vud_comment_widget in your template. Do a check to see if the comment uid is the same as the logged in uid and if so, don't display the widget.

drnikki’s picture

StatusFileSize
new11.6 KB

Taking the lead from Grayside's implementation on http://drupal.org/node/554360#comment-3303302, I've got one implementation that hides the widget in node_view if the current user created the node.

This has not been implemented for comments or fields.

This should be applied after #1194274: Port vud_node to D7 and #1295376: Error when viewing user's votes

marvil07’s picture

Status: Active » Fixed

This should be trivial on 6.x-3.x because #877392: Add hook that allows modules to alter voting permissions was applied there, so the point is just implementing hook_vud_access().

On 7.x-1.x the patch was not applied, actually it's on "to be ported" state. So I guess that would be a better approach.

So, as support request, I guess this can be marked as fixed, and port can follow on the related issue.

drnikki’s picture

@marvil07 - yeah it wasn't a support request from me, per se. Had to implement it for a project so I thought I'd share when I saw this post.

klonos’s picture

Status: Fixed » Active

Please don't mind if I re-open this.

I understand maintainers' urge to close issues in order to clean the queue up, but there is no actual solution that answers the question. Once there is, I will personally update the issue summary to point people to a solution/workaround (for both 6.x & 7.x) and then mark this as fixed. I think this is the proper procedure.

marvil07’s picture

Status: Active » Postponed
klonos’s picture

Title: How to Disallow Voting on Your Own Content » How To: Disallow voting on your own content

Thanx Marco. I've updated the issue's summary.

marvil07’s picture

Status: Postponed » Fixed

The issue mentioned on comment 6 is now fixed, so it's possible now. See vud.api.php for the mentioned hook documentation.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

...status update/mention #877392

kaztur’s picture

Issue summary: View changes

Some necroposting! :)

I've it with so CSS solution and this doesn't hide whole widget but makes it inactive: I show vud wifget in my comment.tpl manually with print $comment->vud_comment_widget construction. So after it I put div tag with class like "own-comment-voting-tweak".
In my theme comments written by viewer have own classes like "comment-by-viewer".

So after adding tweak div tag with CSS margin (negative), floating (or you can make it with absolute positioning) I set that div tag above vud widget woth class like ".comment-by-viewer .own-comment-voting-tweak" - so user cann't click on widget because it hidden under transparent div.

kaztur’s picture

StatusFileSize
new112.83 KB

Screen for previous post.
screen how to disable widget