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 2b0c124 Don't try to access ICLAs except as secretary
2b0c124 is described below
commit 2b0c124286b0c53c50e217435d5c0b0192b220ae
Author: Sebb <[email protected]>
AuthorDate: Wed Dec 30 00:02:35 2020 +0000
Don't try to access ICLAs except as secretary
---
www/roster/main.rb | 16 ++++++++++++----
www/roster/models/committer.rb | 4 ++--
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/www/roster/main.rb b/www/roster/main.rb
index fc2210f..7919a80 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -146,8 +146,12 @@ get '/committer2/index.json' do
ASF::ICLA.each {|icla|
if icla.noId?
- iclaFile = ASF::ICLAFiles.match_claRef(icla.claRef)
- tmp << { name: icla.name, mail: icla.email, claRef: icla.claRef,
iclaFile: iclaFile}
+ if auth[:secretary]
+ iclaFile = ASF::ICLAFiles.match_claRef(icla.claRef) # must be
secretary
+ tmp << { name: icla.name, mail: icla.email, claRef: icla.claRef,
iclaFile: iclaFile}
+ else
+ tmp << { name: icla.name, mail: icla.email, claRef: icla.claRef}
+ end
end
}
index2 = tmp.to_json
@@ -230,8 +234,12 @@ get '/icla/index.json' do
tmp = []
ASF::ICLA.each {|icla|
if icla.noId?
- iclaFile = ASF::ICLAFiles.match_claRef(icla.claRef)
- tmp << { name: icla.name, mail: icla.email, claRef: icla.claRef,
iclaFile: iclaFile}
+ if auth[:secretary]
+ iclaFile = ASF::ICLAFiles.match_claRef(icla.claRef) # must be
secretary
+ tmp << { name: icla.name, mail: icla.email, claRef: icla.claRef,
iclaFile: iclaFile}
+ else
+ tmp << { name: icla.name, mail: icla.email, claRef: icla.claRef}
+ end
end
}
icla_index = tmp.to_json
diff --git a/www/roster/models/committer.rb b/www/roster/models/committer.rb
index b6f7e07..b0dc16b 100644
--- a/www/roster/models/committer.rb
+++ b/www/roster/models/committer.rb
@@ -131,8 +131,8 @@ class Committer
if auth[:member] # i.e. member karma
- if person.icla and person.icla.claRef # Not all people have iclas (only
check if secretary role)
- file = ASF::ICLAFiles.match_claRef(person.icla.claRef)
+ if person.icla and person.icla.claRef and auth[:secretary] # Not all
people have iclas (only check if secretary role)
+ file = ASF::ICLAFiles.match_claRef(person.icla.claRef) # must be
secretary
if file
url =ASF::SVN.svnurl('iclas')
response[:forms][:icla] = "#{url}/#{file}"