From 8c0cd29f0eec37293514e87aaf8e2ed4795b9e48 Mon Sep 17 00:00:00 2001 From: George Vinogradov Date: Mon, 13 Feb 2012 19:21:00 +0400 Subject: [PATCH] [issue #133] Fixed bug with no acl on editing blobs --- app/controllers/git/blobs_controller.rb | 2 ++ app/views/git/blobs/show.html.haml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/git/blobs_controller.rb b/app/controllers/git/blobs_controller.rb index 24335823a..fa4e75386 100644 --- a/app/controllers/git/blobs_controller.rb +++ b/app/controllers/git/blobs_controller.rb @@ -17,9 +17,11 @@ class Git::BlobsController < Git::BaseController end def edit + authorize! :write, @project end def update + authorize! :write, @project # Here might be callbacks for notification purposes: # @git_repository.after_update_file do |repo, sha| # end diff --git a/app/views/git/blobs/show.html.haml b/app/views/git/blobs/show.html.haml index c94f11f38..14f6e6164 100644 --- a/app/views/git/blobs/show.html.haml +++ b/app/views/git/blobs/show.html.haml @@ -23,7 +23,7 @@ #{link_to "Blame", blame_commit_path(@project, @commit_hash, @path)} #{link_to "History", commits_path(@project, @treeish, @path)} - else - #{link_to "Edit", edit_blob_path(@project, @treeish, @path) if choose_render_way(@blob) == :text} + #{link_to "Edit", edit_blob_path(@project, @treeish, @path) if choose_render_way(@blob) == :text and can? :write, @project} #{link_to "Raw", raw_path(@project, @treeish, @path)} #{link_to "Blame", blame_path(@project, @treeish, @path)} #{link_to "History", commits_path(@project, @treeish, @path)}