summaryrefslogtreecommitdiff
path: root/app/controllers/projects/commit_controller.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-01-29 13:38:00 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-06 16:12:23 -0600
commit27f2ca94181880861269a7ddc07ae0d50a656d35 (patch)
treef93a26a7bf263e448f24230950db618bcd73b8f5 /app/controllers/projects/commit_controller.rb
parentd147688af4adb6bcd6cb0f18797c70a8a451f4fa (diff)
downloadgitlab-ce-27f2ca94181880861269a7ddc07ae0d50a656d35.tar.gz
Add 'View on [env]' link to blobs and individual files in diffs
Diffstat (limited to 'app/controllers/projects/commit_controller.rb')
-rw-r--r--app/controllers/projects/commit_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index b5a7078a3a1..08817afa1e9 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -95,6 +95,9 @@ class Projects::CommitController < Projects::ApplicationController
@diffs = commit.diffs(opts)
@notes_count = commit.notes.count
+
+ @environment = @project.latest_environment_for(@commit)
+ @environment = nil unless can?(current_user, :read_environment, @environment)
end
def define_note_vars