Update controller filters

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets
2015-06-26 16:44:21 +02:00
parent 342d553709
commit d63371ad78
6 changed files with 13 additions and 13 deletions
@@ -6,10 +6,10 @@ class Projects::IssuesController < Projects::ApplicationController
before_action :authorize_read_issue!
# Allow write(create) issue
before_action :authorize_write_issue!, only: [:new, :create]
before_action :authorize_create_issue!, only: [:new, :create]
# Allow modify issue
before_action :authorize_modify_issue!, only: [:edit, :update]
before_action :authorize_update_issue!, only: [:edit, :update]
# Allow issues bulk update
before_action :authorize_admin_issues!, only: [:bulk_update]
@@ -122,7 +122,7 @@ class Projects::IssuesController < Projects::ApplicationController
end
end
def authorize_modify_issue!
def authorize_update_issue!
return render_404 unless can?(current_user, :update_issue, @issue)
end