Skip to content

Commit

Permalink
Merge pull request #442 from sparc-request/jl-ml-project-role-bug
Browse files Browse the repository at this point in the history
Needed to add current user as an authorized user if they select someo…
  • Loading branch information
jleonardw9 committed Jun 1, 2016
2 parents 2263c88 + 637e016 commit 1ed8d06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/protocols_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ def create
@current_step = 'user_details'
@protocol.populate_for_edit
elsif @current_step == 'user_details' and @protocol.valid?
@protocol.save
if @protocol.project_roles.where(identity_id: current_user.id).empty?
# if current user is not authorized, add them as an authorized user
@protocol.project_roles.new(identity_id: current_user.id, role: 'general-access-user', project_rights: 'approve')
@protocol.save
end
@current_step = 'return_to_service_request'

if @service_request
Expand Down

0 comments on commit 1ed8d06

Please sign in to comment.