Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-01-29 22:38:00 +0300
committerDouwe Maan <douwe@selenight.nl>2017-02-07 01:12:23 +0300
commit27f2ca94181880861269a7ddc07ae0d50a656d35 (patch)
treef93a26a7bf263e448f24230950db618bcd73b8f5 /app/controllers/projects/commit_controller.rb
parentd147688af4adb6bcd6cb0f18797c70a8a451f4fa (diff)
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