wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r18259: LJSUP-7914. User lj_elections must see e...

Committer: gprochaev
LJSUP-7914. User lj_elections must see election polls. But can't vote.

U   trunk/cgi-bin/LJ/Poll.pm
Modified: trunk/cgi-bin/LJ/Poll.pm
===================================================================
--- trunk/cgi-bin/LJ/Poll.pm	2011-02-10 09:47:56 UTC (rev 18258)
+++ trunk/cgi-bin/LJ/Poll.pm	2011-02-10 10:01:33 UTC (rev 18259)
@@ -1580,6 +1580,17 @@
     my $can_vote_override = LJ::run_hook("can_vote_poll_override", $self);
     return 0 unless !defined $can_vote_override || $can_vote_override;
 
+    ## Only selected maintainers can vote for Supermaintainer election
+    my $is_super = $self->prop ("supermaintainer");
+    if ($is_super) {
+        my @q = $self->questions;
+        my @items = $q[0]->items;
+
+        my @is_can = grep { $_->{item} =~ /\Q$remote->{user}\E/ } @items;
+
+        return @is_can ? 1 : 0;
+    }
+
     return 1;
 }
 

Tags: livejournal, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments