Class: ProtectedTags::CreateService

Inherits:
BaseService show all
Defined in:
app/services/protected_tags/create_service.rb

Instance Attribute Summary collapse

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

This class inherits a constructor from BaseService

Instance Attribute Details

#protected_tagObject (readonly)

Returns the value of attribute protected_tag.


5
6
7
# File 'app/services/protected_tags/create_service.rb', line 5

def protected_tag
  @protected_tag
end

Instance Method Details

#executeObject


7
8
9
10
11
# File 'app/services/protected_tags/create_service.rb', line 7

def execute
  raise Gitlab::Access::AccessDeniedError unless can?(current_user, :admin_project, project)

  project.protected_tags.create(params)
end