diff options
author | Andrew8xx8 <avk@8xx8.ru> | 2013-03-25 14:22:14 +0400 |
---|---|---|
committer | Andrew8xx8 <avk@8xx8.ru> | 2013-03-25 14:22:14 +0400 |
commit | e3351287b4284af95390835bc75a6c3c461f04ba (patch) | |
tree | fa9d25a07359e3deae8ed29beaa6f3f32f933749 /app/controllers/projects/snippets_controller.rb | |
parent | 033037a059c9229df310e3508f9c50beb676bf00 (diff) |
Permissions for Project Snippet fixed
Diffstat (limited to 'app/controllers/projects/snippets_controller.rb')
-rw-r--r-- | app/controllers/projects/snippets_controller.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb index cd14c08c779..92e88de6790 100644 --- a/app/controllers/projects/snippets_controller.rb +++ b/app/controllers/projects/snippets_controller.rb @@ -3,16 +3,16 @@ class Projects::SnippetsController < Projects::ApplicationController before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw] # Allow read any snippet - before_filter :authorize_read_snippet! + before_filter :authorize_read_project_snippet! # Allow write(create) snippet - before_filter :authorize_write_snippet!, only: [:new, :create] + before_filter :authorize_write_project_snippet!, only: [:new, :create] # Allow modify snippet - before_filter :authorize_modify_snippet!, only: [:edit, :update] + before_filter :authorize_modify_project_snippet!, only: [:edit, :update] # Allow destroy snippet - before_filter :authorize_admin_snippet!, only: [:destroy] + before_filter :authorize_admin_project_snippet!, only: [:destroy] layout 'project_resource' @@ -80,11 +80,11 @@ class Projects::SnippetsController < Projects::ApplicationController @snippet ||= @project.snippets.find(params[:id]) end - def authorize_modify_snippet! + def authorize_modify_project_snippet! return render_404 unless can?(current_user, :modify_project_snippet, @snippet) end - def authorize_admin_snippet! + def authorize_admin_project_snippet! return render_404 unless can?(current_user, :admin_project_snippet, @snippet) end |