diff options
Diffstat (limited to 'lib/gitlab/deploy_key_access.rb')
-rw-r--r-- | lib/gitlab/deploy_key_access.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/gitlab/deploy_key_access.rb b/lib/gitlab/deploy_key_access.rb index ca16582d2b4..a582c978be7 100644 --- a/lib/gitlab/deploy_key_access.rb +++ b/lib/gitlab/deploy_key_access.rb @@ -17,11 +17,14 @@ module Gitlab attr_reader :deploy_key def protected_tag_accessible_to?(ref, action:) - assert_project! - - # a deploy key can always push a protected tag - # (which is not always the case when pushing to a protected branch) - true + if Feature.enabled?(:deploy_key_for_protected_tags, project) + super + else + assert_project! + # a deploy key can always push a protected tag + # (which is not always the case when pushing to a protected branch) + true + end end def can_collaborate?(_ref) |