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

rubys 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 ca83d4b  prep for fine grained PPMC ACL
ca83d4b is described below

commit ca83d4b47c1272147b3c8bb4d3b617a7fc8983fa
Author: Sam Ruby <[email protected]>
AuthorDate: Tue Jun 6 12:59:10 2017 -0400

    prep for fine grained PPMC ACL
---
 www/roster/views/ppmc/committers.js.rb |  6 +++---
 www/roster/views/ppmc/main.js.rb       | 27 +++++++++++++++++++--------
 www/roster/views/ppmc/members.js.rb    |  6 +++---
 www/roster/views/ppmc/mentors.js.rb    |  8 ++++----
 4 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/www/roster/views/ppmc/committers.js.rb 
b/www/roster/views/ppmc/committers.js.rb
index edcba61..bcb6982 100644
--- a/www/roster/views/ppmc/committers.js.rb
+++ b/www/roster/views/ppmc/committers.js.rb
@@ -47,7 +47,7 @@ class PPMCCommitters < React
            end
          end
 
-          if @@auth
+          if @@auth and @@auth.ppmc
             _tr onClick: self.select do
               _td((@state == :open ? '' : "\u2795"), colspan: 3)
             end
@@ -84,7 +84,7 @@ class PPMCCommitters < React
 
   # open search box
   def select()
-    return unless @@auth
+    return unless @@auth and @@auth.ppmc
     window.getSelection().removeAllRanges()
     @state = ( @state == :open ? :closed : :open )
   end
@@ -164,7 +164,7 @@ class PPMCCommitter < React
 
   # toggle display of buttons
   def select()
-    return unless @@auth
+    return unless @@auth and @@auth.ppmc
     window.getSelection().removeAllRanges()
     @state = ( @state == :open ? :closed : :open )
   end
diff --git a/www/roster/views/ppmc/main.js.rb b/www/roster/views/ppmc/main.js.rb
index 51343ce..fc9f394 100644
--- a/www/roster/views/ppmc/main.js.rb
+++ b/www/roster/views/ppmc/main.js.rb
@@ -8,8 +8,10 @@ class PPMC < React
   end
 
   def render
-    auth = @@auth and (@@auth.secretary or @@auth.root or
-      @ppmc.owners.include? @@auth.id)
+    if @@auth
+      @@auth.ppmc = (@@auth.secretary or @@auth.root or
+        @ppmc.owners.include? @@auth.id)
+    end
 
     # header
     _h1 do
@@ -21,9 +23,16 @@ class PPMC < React
     _p @ppmc.description
 
     # usage information for authenticated users (PMC chair, etc.)
-    if auth
+    if @@auth.ppmc or @@auth.ipmc
       _div.alert.alert_success do
-        _span 'Double click on a row to show actions.'
+        if (@@auth.ppmc and @@auth.ipmc) or @@auth.root or @@auth.secretary
+          _span 'Double click on a row to show actions.'
+        elsif @@auth.ppmc
+          _span 'Double click on a PPMC or Committers row to show actions.'
+        else
+          _span 'Double click on a Mentors row to show actions.'
+        end
+
         unless @ppmc.roster.keys().empty?
           _span "  Click on \u2795 to add."
           _span "  Multiple people can be added with a single confirmation."
@@ -37,9 +46,9 @@ class PPMC < React
     end
 
     # main content
-    _PPMCMentors auth: @@auth.ipmc, ppmc: @ppmc
-    _PPMCMembers auth: auth, ppmc: @ppmc
-    _PPMCCommitters auth: auth, ppmc: @ppmc
+    _PPMCMentors auth: @@auth, ppmc: @ppmc
+    _PPMCMembers auth: @@auth, ppmc: @ppmc
+    _PPMCCommitters auth: @@auth, ppmc: @ppmc
 
     # mailing lists
     if @ppmc.moderators
@@ -92,7 +101,9 @@ class PPMC < React
     _PPMCGraduate ppmc: @ppmc, id: @@auth.id
 
     # hidden form
-    _Confirm action: :ppmc, project: @ppmc.id, update: self.update if auth
+    if @@auth.ppmc or @@auth.ipmc
+      _Confirm action: :ppmc, project: @ppmc.id, update: self.update
+    end
   end
 
   # capture ppmc on initial load
diff --git a/www/roster/views/ppmc/members.js.rb 
b/www/roster/views/ppmc/members.js.rb
index fe15cd3..8e324cf 100644
--- a/www/roster/views/ppmc/members.js.rb
+++ b/www/roster/views/ppmc/members.js.rb
@@ -48,7 +48,7 @@ class PPMCMembers < React
           end
         end
 
-        if @@auth and not @@ppmc.roster.keys().empty?
+        if @@auth and @@auth.ppmc and not @@ppmc.roster.keys().empty?
           _tr onClick: self.select do
             _td((@state == :open ? '' : "\u2795"), colspan: 4)
           end
@@ -84,7 +84,7 @@ class PPMCMembers < React
 
   # open search box
   def select()
-    return unless @@auth
+    return unless @@auth and @@auth.ppmc
     window.getSelection().removeAllRanges()
     @state = ( @state == :open ? :closed : :open )
   end
@@ -179,7 +179,7 @@ class PPMCMember < React
 
   # toggle display of buttons
   def select()
-    return unless @@auth
+    return unless @@auth and @@auth.ppmc
     window.getSelection().removeAllRanges()
     @state = ( @state == :open ? :closed : :open )
   end
diff --git a/www/roster/views/ppmc/mentors.js.rb 
b/www/roster/views/ppmc/mentors.js.rb
index ed0dc62..559a595 100644
--- a/www/roster/views/ppmc/mentors.js.rb
+++ b/www/roster/views/ppmc/mentors.js.rb
@@ -48,7 +48,7 @@ class PPMCMentors < React
           end
         end
 
-        if @@auth and not @@ppmc.roster.keys().empty?
+        if @@auth and @@auth.ipmc and not @@ppmc.roster.keys().empty?
           _tr onClick: self.select do
             _td((@state == :open ? '' : "\u2795"), colspan: 4)
           end
@@ -84,7 +84,7 @@ class PPMCMentors < React
 
   # fetch IPMC list
   def componentDidMount()
-    return unless @@auth
+    return unless @@auth and @@auth.ipmc
     Polyfill.require(%w(Promise fetch)) do
       fetch('committee/incubator.json', credentials: 'include').then 
{|response|
        if response.status == 200
@@ -102,7 +102,7 @@ class PPMCMentors < React
 
   # open search box
   def select()
-    return unless @@auth
+    return unless @@auth and @@auth.ipmc
     window.getSelection().removeAllRanges()
     @state = ( @state == :open ? :closed : :open )
   end
@@ -195,7 +195,7 @@ class PPMCMentor < React
 
   # toggle display of buttons
   def select()
-    return unless @@auth
+    return unless @@auth and @@auth.ipmc
     window.getSelection().removeAllRanges()
     @state = ( @state == :open ? :closed : :open )
   end

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to