diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /app/services/releases/create_service.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'app/services/releases/create_service.rb')
-rw-r--r-- | app/services/releases/create_service.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/releases/create_service.rb b/app/services/releases/create_service.rb index 2588d2187a5..b7df201824a 100644 --- a/app/services/releases/create_service.rb +++ b/app/services/releases/create_service.rb @@ -4,6 +4,7 @@ module Releases class CreateService < Releases::BaseService def execute return error('Access Denied', 403) unless allowed? + return error('You are not allowed to create this tag as it is protected.', 403) unless can_create_tag? return error('Release already exists', 409) if release return error("Milestone(s) not found: #{inexistent_milestones.join(', ')}", 400) if inexistent_milestones.any? @@ -38,7 +39,7 @@ module Releases end def allowed? - Ability.allowed?(current_user, :create_release, project) && can_create_tag? + Ability.allowed?(current_user, :create_release, project) end def can_create_tag? |