Class: Mattermost::CreateTeamService
- Inherits:
-
BaseService
- Object
- BaseService
- Mattermost::CreateTeamService
- Defined in:
- app/services/mattermost/create_team_service.rb
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(group, current_user) ⇒ CreateTeamService
constructor
A new instance of CreateTeamService.
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
Constructor Details
#initialize(group, current_user) ⇒ CreateTeamService
Returns a new instance of CreateTeamService.
5 6 7 8 |
# File 'app/services/mattermost/create_team_service.rb', line 5 def initialize(group, current_user) @group = group @current_user = current_user end |
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 |
# File 'app/services/mattermost/create_team_service.rb', line 10 def execute # The user that creates the team will be Team Admin ::Mattermost::Team.new(current_user).create(**@group.mattermost_team_params) rescue ::Mattermost::ClientError => e @group.errors.add(:mattermost_team, e.) end |