Skip to content

Commit

Permalink
Merge pull request #7489 from coolo/require_login
Browse files Browse the repository at this point in the history
Require login for edit_comment
  • Loading branch information
bgeuken committed Apr 27, 2019
2 parents 1578d13 + ca10bd3 commit d9daa83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/project_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Webui::ProjectController < Webui::WebuiController
before_action :lockout_spiders, only: [:requests, :rebuild_time, :buildresults]

before_action :require_login, only: [:create, :toggle_watch, :destroy, :new,
:new_release_request, :new_package_branch, :new_package]
:new_release_request, :new_package_branch, :new_package, :edit_comment]

before_action :set_project, only: [:autocomplete_repositories, :users, :subprojects,
:new_package, :new_package_branch, :incident_request_dialog, :release_request_dialog,
Expand Down
3 changes: 1 addition & 2 deletions src/api/spec/controllers/webui/project_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,7 @@
post :edit_comment, params: { project: user.home_project, package: package, text: text, last_comment: 'Last comment', format: 'js' }
end

it { expect(assigns(:comment)).to eq('Last comment') }
it { expect(assigns(:error)).to eq("Can't create attributes in home_package") }
it { expect(response).to redirect_to(session_new_path) }
end
end

Expand Down

0 comments on commit d9daa83

Please sign in to comment.