post votes: let gold users use upvote:self, downvote:self metatags.
* Let gold users use upvote:self, downvote:self metatags to search for their own votes. * Don't let mods use upvote:<user>, downvote:<user> metatags to see votes by other users. Only let admins see other users' votes. * Add vote count to profile page.
This commit is contained in:
@@ -774,13 +774,17 @@ class Tag < ApplicationRecord
|
||||
end
|
||||
|
||||
when "upvote"
|
||||
if CurrentUser.user.is_moderator?
|
||||
q[:upvote] = User.name_to_id(g2)
|
||||
if CurrentUser.user.is_admin?
|
||||
q[:upvote] = User.find_by_name(g2)
|
||||
elsif CurrentUser.user.is_voter?
|
||||
q[:upvote] = CurrentUser.user
|
||||
end
|
||||
|
||||
when "downvote"
|
||||
if CurrentUser.user.is_moderator?
|
||||
q[:downvote] = User.name_to_id(g2)
|
||||
if CurrentUser.user.is_admin?
|
||||
q[:downvote] = User.find_by_name(g2)
|
||||
elsif CurrentUser.user.is_voter?
|
||||
q[:downvote] = CurrentUser.user
|
||||
end
|
||||
|
||||
when *COUNT_METATAGS
|
||||
|
||||
Reference in New Issue
Block a user