diff options
author | Rémy Coutable <remy@rymai.me> | 2018-02-16 15:10:22 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-02-27 16:02:22 +0100 |
commit | 1c88d92b3fe174a56080575a14d6b473f17f7d8f (patch) | |
tree | 7150c48b368e82d70f6bfc228c3d836c7be7c3ac /app/models/member.rb | |
parent | e82f629be4b9c91e2611095cd4296e487ed137ef (diff) | |
download | gitlab-ce-1c88d92b3fe174a56080575a14d6b473f17f7d8f.tar.gz |
Improve Member servicesrc/reduce-delta-with-ce-in-controllers-ce
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index ba040bbeff0..408e8b2d704 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -128,7 +128,7 @@ class Member < ActiveRecord::Base find_by(invite_token: invite_token) end - def add_user(source, user, access_level, existing_members: nil, current_user: nil, expires_at: nil) + def add_user(source, user, access_level, existing_members: nil, current_user: nil, expires_at: nil, ldap: false) # `user` can be either a User object, User ID or an email to be invited member = retrieve_member(source, user, existing_members) access_level = retrieve_access_level(access_level) @@ -143,10 +143,13 @@ class Member < ActiveRecord::Base if member.request? ::Members::ApproveAccessRequestService.new( - source, current_user, access_level: access_level - ).execute(member) + ).execute( + member, + skip_authorization: ldap, + skip_log_audit_event: ldap + ) else member.save end |