Class: Members::DestroyService
- Inherits:
-
BaseService
- Object
- BaseService
- BaseService
- Members::DestroyService
- Includes:
- Gitlab::ExclusiveLeaseHelpers
- Defined in:
- app/services/members/destroy_service.rb
Constant Summary
Constants included from Gitlab::ExclusiveLeaseHelpers
Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute(member, skip_authorization: false, skip_subresources: false, unassign_issuables: false, destroy_bot: false, skip_saml_identity: false) ⇒ Object
-
#mark_as_recursive_call ⇒ Object
We use this to mark recursive calls made to this service from within the same service.
Methods included from Gitlab::ExclusiveLeaseHelpers
Methods inherited from BaseService
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 Members::BaseService
Instance Method Details
#execute(member, skip_authorization: false, skip_subresources: false, unassign_issuables: false, destroy_bot: false, skip_saml_identity: false) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/members/destroy_service.rb', line 7 def execute( member, skip_authorization: false, skip_subresources: false, unassign_issuables: false, destroy_bot: false, skip_saml_identity: false ) unless raise Gitlab::Access::AccessDeniedError unless (member, destroy_bot) raise Gitlab::Access::AccessDeniedError if (member) && cannot_revoke_owner_responsibilities_from_member_in_project?(member) end @skip_auth = if a_group_owner?(member) process_destroy_of_group_owner_member(member, skip_subresources, skip_saml_identity) else destroy_member(member) (member, skip_subresources, skip_saml_identity) end enqueue_jobs_that_needs_to_be_run_only_once_per_hierarchy(member, unassign_issuables) member end |
#mark_as_recursive_call ⇒ Object
We use this to mark recursive calls made to this service from within the same service. We do this so as to help us run some tasks that needs to be run only once per hierarchy, and not recursively.
39 40 41 |
# File 'app/services/members/destroy_service.rb', line 39 def mark_as_recursive_call @recursive_call = true end |