diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-30 21:09:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-30 21:09:50 +0300 |
commit | 6619ed911ffab93b90756bf392d2925fdc0c1ee2 (patch) | |
tree | 79d122438dd8e1cb672f8bb52b9d573bd49bdd77 /app/presenters/commit_presenter.rb | |
parent | 4b1fc3dc32e768499d81ed64ea7ed497c1785c48 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters/commit_presenter.rb')
-rw-r--r-- | app/presenters/commit_presenter.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/presenters/commit_presenter.rb b/app/presenters/commit_presenter.rb index 7df45ca03bb..2cb88179845 100644 --- a/app/presenters/commit_presenter.rb +++ b/app/presenters/commit_presenter.rb @@ -5,12 +5,20 @@ class CommitPresenter < Gitlab::View::Presenter::Delegated presents ::Commit, as: :commit - def status_for(ref) + def detailed_status_for(ref) + return unless can?(current_user, :read_pipeline, commit.latest_pipeline(ref)) return unless can?(current_user, :read_commit_status, commit.project) commit.latest_pipeline(ref)&.detailed_status(current_user) end + def status_for(ref = nil) + return unless can?(current_user, :read_pipeline, commit.latest_pipeline(ref)) + return unless can?(current_user, :read_commit_status, commit.project) + + commit.status(ref) + end + def any_pipelines? return false unless can?(current_user, :read_pipeline, commit.project) |