Class: Groups::NestedCreateService
- Inherits:
-
BaseService
- Object
- BaseService
- BaseService
- Groups::NestedCreateService
- Defined in:
- app/services/groups/nested_create_service.rb
Instance Attribute Summary collapse
-
#group_path ⇒ Object
readonly
Returns the value of attribute group_path.
-
#visibility_level ⇒ Object
readonly
Returns the value of attribute visibility_level.
Attributes inherited from BaseService
#current_user, #group, #params
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(user, params) ⇒ NestedCreateService
constructor
A new instance of NestedCreateService.
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service
Methods included from Gitlab::Allowable
Constructor Details
#initialize(user, params) ⇒ NestedCreateService
Returns a new instance of NestedCreateService.
7 8 9 10 11 12 13 |
# File 'app/services/groups/nested_create_service.rb', line 7 def initialize(user, params) @current_user = user @params = params.dup @group_path = @params.delete(:group_path) @visibility_level = @params.delete(:visibility_level) || Gitlab::CurrentSettings.current_application_settings.default_group_visibility end |
Instance Attribute Details
#group_path ⇒ Object (readonly)
Returns the value of attribute group_path.
5 6 7 |
# File 'app/services/groups/nested_create_service.rb', line 5 def group_path @group_path end |
#visibility_level ⇒ Object (readonly)
Returns the value of attribute visibility_level.
5 6 7 |
# File 'app/services/groups/nested_create_service.rb', line 5 def visibility_level @visibility_level end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/services/groups/nested_create_service.rb', line 15 def execute return unless group_path if namespace = namespace_or_group(group_path) return namespace end create_group_path end |