diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-07 06:08:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-07 06:08:47 +0300 |
commit | 0dce207848e4dd4425c116fb91a5cd2b41a8ec59 (patch) | |
tree | 72b4ad1a34cae6a4a0d552416528d42167d1a39f /app/services/releases | |
parent | 3462d7613fb761a4cbf2904c6980fd39b6f8bd5f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/releases')
-rw-r--r-- | app/services/releases/create_service.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/releases/create_service.rb b/app/services/releases/create_service.rb index 52d95872414..2aac5644b84 100644 --- a/app/services/releases/create_service.rb +++ b/app/services/releases/create_service.rb @@ -44,7 +44,13 @@ module Releases end def allowed? - Ability.allowed?(current_user, :create_release, project) + Ability.allowed?(current_user, :create_release, project) && can_create_tag? + end + + def can_create_tag? + return true unless ::Feature.enabled?(:evalute_protected_tag_for_release_permissions, project, default_enabled: :yaml) + + ::Gitlab::UserAccess.new(current_user, container: project).can_create_tag?(tag_name) end def create_release(tag, evidence_pipeline) |