whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: allow PMC chairs to post reports
Date Fri, 09 Aug 2019 14:24:27 GMT
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 3308e0f  allow PMC chairs to post reports
3308e0f is described below

commit 3308e0f4c3dac1f025b6a3ab1784eb3fdcf638ac
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Fri Aug 9 10:24:07 2019 -0400

    allow PMC chairs to post reports
---
 www/board/agenda/views/actions/post.json.rb | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/www/board/agenda/views/actions/post.json.rb b/www/board/agenda/views/actions/post.json.rb
index e6427dc..9f7f47a 100644
--- a/www/board/agenda/views/actions/post.json.rb
+++ b/www/board/agenda/views/actions/post.json.rb
@@ -18,14 +18,15 @@ attach = nil
 
 # Determine if user is authorized
 user = ASF::Person.find(env.user)
-member_or_officer = user.asf_member? or ASF.pmc_chairs.include? user
-credentials = (member_or_officer or not env.password) ? 
-  nil : [['--username', 'whimsysvn']]
+member_or_officer = (user.asf_member? or ASF.pmc_chairs.include? user)
+real_web_server = env.password
+alternate_credentials = (real_web_server and not member_or_officer) ?
+  [['--username', 'whimsysvn']] : nil
 
 # prepend user id to message if whimsysvn role account is used
-@message = "#{env.user}: #{@message}" if env.user and credentials
+@message = "#{env.user}: #{@message}" if env.user and alternate_credentials
 
-Agenda.update(@agenda, @message, auth: credentials) do |agenda|
+Agenda.update(@agenda, @message, auth: alternate_credentials) do |agenda|
   # quick parse of agenda
   parsed = ASF::Board::Agenda.parse(agenda, true)
 
@@ -173,7 +174,7 @@ end
 
 # filter agenda if project is specified or the user is not authorized to see
 # the entire document
-if @project or credentials
+if @project or alternate_credentials
   agenda = _.delete 'agenda'
  _item agenda.find {|report| report[:attach] == attach}
 end


Mime
View raw message