From 342d5537091e61c1fc52f3e54df926159f326eb8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 26 Jun 2015 15:55:56 +0200 Subject: Rename abilities to correspond contoller/model action names write_ was renamed to create_ modify_ was renamed to update_ So now in update action we have next code def create can?(current_user, :create_issue, @issue) end def update can?(current_user, :update_issue, @issue) end Signed-off-by: Dmitriy Zaporozhets --- app/controllers/snippets_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/snippets_controller.rb') diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index cf672c5c093..0ca71c155c5 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -88,7 +88,7 @@ class SnippetsController < ApplicationController end def authorize_modify_snippet! - return render_404 unless can?(current_user, :modify_personal_snippet, @snippet) + return render_404 unless can?(current_user, :update_personal_snippet, @snippet) end def authorize_admin_snippet! -- cgit v1.2.1 From d63371ad783db055da840be37ddac0cdcb49db2c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 26 Jun 2015 16:44:21 +0200 Subject: Update controller filters Signed-off-by: Dmitriy Zaporozhets --- app/controllers/snippets_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers/snippets_controller.rb') diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index 0ca71c155c5..8e7e45c781f 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -2,7 +2,7 @@ class SnippetsController < ApplicationController before_action :snippet, only: [:show, :edit, :destroy, :update, :raw] # Allow modify snippet - before_action :authorize_modify_snippet!, only: [:edit, :update] + before_action :authorize_update_snippet!, only: [:edit, :update] # Allow destroy snippet before_action :authorize_admin_snippet!, only: [:destroy] @@ -87,7 +87,7 @@ class SnippetsController < ApplicationController end end - def authorize_modify_snippet! + def authorize_update_snippet! return render_404 unless can?(current_user, :update_personal_snippet, @snippet) end -- cgit v1.2.1