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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-26 15:12:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-26 15:12:49 +0300
commit5343536f2bb402bc767db2d015e45ac87189d7c3 (patch)
tree29e7630ace5f465f0b3d6374c044dbb57227d694 /app/presenters/blob_presenter.rb
parentbc8f298b647859a411d38a440c397e5990ef4941 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters/blob_presenter.rb')
-rw-r--r--app/presenters/blob_presenter.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/presenters/blob_presenter.rb b/app/presenters/blob_presenter.rb
index 5835a77d0b9..3555c6c3d0c 100644
--- a/app/presenters/blob_presenter.rb
+++ b/app/presenters/blob_presenter.rb
@@ -78,6 +78,12 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
super(blob, project, blob.commit_id)
end
+ def can_current_user_push_to_branch?
+ return false unless current_user && project.repository.branch_exists?(blob.commit_id)
+
+ user_access(project).can_push_to_branch?(blob.commit_id)
+ end
+
def ide_edit_path
super(project, blob.commit_id, blob.path)
end