Class: Members::ApproveAccessRequestService

Inherits:
BaseService show all
Includes:
MembershipLockValidation
Defined in:
app/services/members/approve_access_request_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

#initialize

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?, #can_all?, #can_any?

Constructor Details

This class inherits a constructor from Members::BaseService

Instance Method Details

#execute(access_requester, skip_authorization: false, skip_log_audit_event: false) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'app/services/members/approve_access_request_service.rb', line 7

def execute(access_requester, skip_authorization: false, skip_log_audit_event: false)
  validate_access!(access_requester) unless skip_authorization

  access_requester.access_level = params[:access_level] if params[:access_level]

  handle_request_acceptance(access_requester)

  after_execute(member: access_requester, skip_log_audit_event: skip_log_audit_event)

  success({ member: access_requester })
end