diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/access_requests.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/api/access_requests.rb b/lib/api/access_requests.rb index 29a97ccbd75..9d1d9058996 100644 --- a/lib/api/access_requests.rb +++ b/lib/api/access_requests.rb @@ -55,13 +55,8 @@ module API put ':id/access_requests/:user_id/approve' do required_attributes! [:user_id] source = find_source(source_type, params[:id]) - authorize_admin_source!(source_type, source) - member = source.requesters.find_by!(user_id: params[:user_id]) - if params[:access_level] - member.update(access_level: params[:access_level]) - end - member.accept_request + member = ::Members::ApproveAccessRequestService.new(source, current_user, params).execute status :created present member.user, with: Entities::Member, member: member |