You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2018/05/20 12:47:52 UTC

[whimsy] branch master updated: WHIMSY-194 Allow PMC members to subscribe to their private lists

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 852b363  WHIMSY-194 Allow PMC members to subscribe to their private lists
852b363 is described below

commit 852b363589c59a24f03fedf293964336d1de756b
Author: Sebb <se...@apache.org>
AuthorDate: Sun May 20 13:47:50 2018 +0100

    WHIMSY-194 Allow PMC members to subscribe to their private lists
---
 lib/whimsy/asf/mail.rb       | 7 ++++++-
 www/committers/subscribe.cgi | 8 +++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/whimsy/asf/mail.rb b/lib/whimsy/asf/mail.rb
index 61f86dd..d8d6923 100644
--- a/lib/whimsy/asf/mail.rb
+++ b/lib/whimsy/asf/mail.rb
@@ -71,7 +71,7 @@ module ASF
     end
 
     # which lists are available for subscription via Whimsy?
-    def self.cansub(member, pmc_chair)
+    def self.cansub(member, pmc_chair, ldap_pmcs)
       Mail._load_lists
       if member
           lists = @lists.keys
@@ -87,6 +87,11 @@ module ASF
           if pmc_chair
             lists += ['board', 'board-commits', 'board-chat']
           end
+          if ldap_pmcs
+            ldap_pmcs.each do |lp|
+              lists += [lp + '-private']
+            end
+          end
           lists
       end
     end
diff --git a/www/committers/subscribe.cgi b/www/committers/subscribe.cgi
index 03765b8..eb4ca13 100755
--- a/www/committers/subscribe.cgi
+++ b/www/committers/subscribe.cgi
@@ -37,7 +37,9 @@ ASF::Podling.list.each {|p|
 }
 
 pmcs = ASF::Committee.pmcs.map(&:mail_list)
-lists = ASF::Mail.cansub(user.asf_member?, ASF.pmc_chairs.include?(user))
+ldap_pmcs = [] # No need to get the info for ASF members
+ldap_pmcs = user.committees.map(&:name) unless user.asf_member?
+lists = ASF::Mail.cansub(user.asf_member?, ASF.pmc_chairs.include?(user), ldap_pmcs)
 lists -= ASF::Mail.deprecated
 lists -= BLACKLIST
 lists.sort!
@@ -69,9 +71,9 @@ _html do
           _ 'where you can change your primary Forwarding Address and any other associated Alias email addresses you use.'
         end
         _p do
-          _ 'Only ASF members can use this form to subscribe to private lists. PMC chairs can subscribe to board lists.'
+          _ 'ASF members can use this form to subscribe to private lists. PMC chairs can subscribe to board lists. PMC members can subscribe to their private@ list.'
           _br
-          _ 'To subscribe to other private lists, send an email to the list-subscribe@ address and wait for the request to be approved.'
+          _ 'To subscribe to other private lists, send an email to the list-subscribe@ address and wait for the request to be manually approved.'
           _ 'This might take a day or two.'
         end
         _p do

-- 
To stop receiving notification emails like this one, please contact
sebb@apache.org.