diff options
Diffstat (limited to 'app/services/releases/base_service.rb')
-rw-r--r-- | app/services/releases/base_service.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/services/releases/base_service.rb b/app/services/releases/base_service.rb index 9dd0c9a007a..b4b493624e7 100644 --- a/app/services/releases/base_service.rb +++ b/app/services/releases/base_service.rb @@ -5,6 +5,8 @@ module Releases include BaseServiceUtility include Gitlab::Utils::StrongMemoize + ReleaseProtectedTagAccessError = Class.new(StandardError) + attr_accessor :project, :current_user, :params def initialize(project, user = nil, params = {}) @@ -81,6 +83,15 @@ module Releases release.execute_hooks(action) end + def track_protected_tag_access_error! + unless ::Gitlab::UserAccess.new(current_user, container: project).can_create_tag?(tag_name) + Gitlab::ErrorTracking.log_exception( + ReleaseProtectedTagAccessError.new, + project_id: project.id, + user_id: current_user.id) + end + end + # overridden in EE def project_group_id; end end |