diff options
Diffstat (limited to 'app/controllers/projects/snippets_controller.rb')
-rw-r--r-- | app/controllers/projects/snippets_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb index a0caa4018c3..64306637423 100644 --- a/app/controllers/projects/snippets_controller.rb +++ b/app/controllers/projects/snippets_controller.rb @@ -6,10 +6,10 @@ class Projects::SnippetsController < Projects::ApplicationController before_action :authorize_read_project_snippet! # Allow write(create) snippet - before_action :authorize_write_project_snippet!, only: [:new, :create] + before_action :authorize_create_project_snippet!, only: [:new, :create] # Allow modify snippet - before_action :authorize_modify_project_snippet!, only: [:edit, :update] + before_action :authorize_update_project_snippet!, only: [:edit, :update] # Allow destroy snippet before_action :authorize_admin_project_snippet!, only: [:destroy] @@ -75,7 +75,7 @@ class Projects::SnippetsController < Projects::ApplicationController @snippet ||= @project.snippets.find(params[:id]) end - def authorize_modify_project_snippet! + def authorize_update_project_snippet! return render_404 unless can?(current_user, :update_project_snippet, @snippet) end |