Class: Projects::GroupLinks::DestroyService
- Inherits:
-
BaseService
- Object
- BaseService
- Projects::GroupLinks::DestroyService
- Defined in:
- app/services/projects/group_links/destroy_service.rb
Constant Summary
Constants inherited from BaseService
BaseService::UnauthorizedError
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
Methods inherited from BaseService
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
This class inherits a constructor from BaseService
Instance Method Details
#execute(group_link, skip_authorization: false) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/services/projects/group_links/destroy_service.rb', line 6 def execute(group_link, skip_authorization: false) return not_found! unless group_link unless || allowed_to_destroy_link?(group_link) return ServiceResponse.error(message: 'Forbidden', reason: :forbidden) end if group_link.project.private? TodosDestroyer::ProjectPrivateWorker.perform_in(Todo::WAIT_FOR_DELETE, project.id) else TodosDestroyer::ConfidentialIssueWorker.perform_in(Todo::WAIT_FOR_DELETE, nil, project.id) end link = group_link.destroy (link.project) # Until we compare the inconsistency rates of the new specialized worker and # the old approach, we still run AuthorizedProjectsWorker # but with some delay and lower urgency as a safety net. AuthorizedProjectUpdate::EnqueueGroupMembersRefreshAuthorizedProjectsWorker.perform_async(link.group.id) ServiceResponse.success(payload: { link: link }) end |