diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-14 18:11:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-14 18:11:29 +0300 |
commit | 2d80ade70258fa78e9ada2e8b3055129a69654f3 (patch) | |
tree | a23e474b4cc5184db445a6121f9eb75c0653fe5f /app/presenters | |
parent | 61a82b8ec062d6f122dadd38783c7754cef7ce2b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/release_presenter.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/presenters/release_presenter.rb b/app/presenters/release_presenter.rb index fc47ece6199..70fe6324712 100644 --- a/app/presenters/release_presenter.rb +++ b/app/presenters/release_presenter.rb @@ -4,13 +4,13 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated presents ::Release, as: :release def commit_path - return unless release.commit && can_download_code? + return unless release.commit && can_read_code? project_commit_path(project, release.commit.id) end def tag_path - return unless can_download_code? + return unless can_read_code? project_tag_path(project, release.tag) end @@ -47,7 +47,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated delegator_override :assets_count def assets_count - if can_download_code? + if can_read_code? release.assets_count else release.assets_count(except: [:sources]) @@ -67,8 +67,8 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated private - def can_download_code? - can?(current_user, :download_code, project) + def can_read_code? + can?(current_user, :read_code, project) end def params_for_issues_and_mrs(state: 'opened') |