[issue #133] Fixed bug with no acl on editing blobs

This commit is contained in:
George Vinogradov 2012-02-13 19:21:00 +04:00
parent 391716fee5
commit 8c0cd29f0e
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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)}