diff options
author | Rémy Coutable <remy@rymai.me> | 2016-07-28 20:30:34 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-22 16:50:47 +0300 |
commit | b3f0a82f501ce26717a6f9e57d91cb2b1f1a967b (patch) | |
tree | d4eabb5b40c1140fd6619084ff11e849d44eb7db /lib | |
parent | 8071dc83fa00361b7bdee6e76ef2d4a59851b154 (diff) |
New Members::ApproveAccessRequestService
Signed-off-by: Rémy Coutable <remy@rymai.me>
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 |