Skip to content

Commit

Permalink
wth - (SPARCRequest & SPARCDashboard) Switching PI Bug
Browse files Browse the repository at this point in the history
On SPARCRequest and SPARCDashboard, when switching PIs by adding a new
primary PI on the protocol, it is defaulting the previous PI to
"Request/Approve Services" right, which doesn't exist any more.

I updated the two classes in /lib that handle this update and set the
project rights to 'approve'. [#145688447]

Pivotal Story - (https://www.pivotaltracker.com/story/show/145688447)

Steps to Test:
1. Find existing Protocol
2. Add a new Primary PI, which will replace the old one.
3. Proxy rights should remain as they were.
  • Loading branch information
William Holt committed May 22, 2017
1 parent 2603c1c commit 0d3171b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/associated_user_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def initialize(params)
@successful = true
if @protocol_role.role == 'primary-pi'
protocol.project_roles.primary_pis.each do |pr|
pr.update_attributes(project_rights: 'request', role: 'general-access-user')
pr.update_attributes(project_rights: 'approve', role: 'general-access-user')
end
end
@protocol_role.save
Expand Down
2 changes: 1 addition & 1 deletion lib/associated_user_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def initialize(params)

if @protocol_role.role == 'primary-pi'
protocol.project_roles.where(role: 'primary-pi').where.not(identity_id: @protocol_role.identity_id).each do |pr|
pr.update_attributes(project_rights: 'request', role: 'general-access-user')
pr.update_attributes(project_rights: 'approve', role: 'general-access-user')
end
end

Expand Down

0 comments on commit 0d3171b

Please sign in to comment.