diff --git a/app/controllers/my_profile/profile_roles_controller.rb b/app/controllers/my_profile/profile_roles_controller.rb index f5f4cb3..51b8c2f 100644 --- a/app/controllers/my_profile/profile_roles_controller.rb +++ b/app/controllers/my_profile/profile_roles_controller.rb @@ -11,8 +11,9 @@ class ProfileRolesController < MyProfileController end def create - @role = Role.create({:name => params[:role][:name], :permissions => params[:role][:permissions], :profile_id => profile.id, :environment => environment }, :without_protection => true) + @role = Role.new({:name => params[:role][:name], :permissions => params[:role][:permissions], :environment => environment }, :without_protection => true) if @role.save + profile.custom_roles << @role redirect_to :action => 'show', :id => @role else session[:notice] = _('Failed to create role') diff --git a/app/views/tasks/_add_member_accept_details.html.erb b/app/views/tasks/_add_member_accept_details.html.erb index e3470cc..c3f06ba 100644 --- a/app/views/tasks/_add_member_accept_details.html.erb +++ b/app/views/tasks/_add_member_accept_details.html.erb @@ -1,5 +1,5 @@ <%= content = _("Roles:")+"
" -roles = Profile::Roles.organization_all_roles(task.target.environment.id) +roles = Profile::Roles.organization_member_roles(task.target.environment.id) + profile.custom_roles roles.each do |role| content += labelled_check_box(role.name, "tasks[#{task.id}][task][roles][]", role.id, false)+"
" end -- libgit2 0.21.2