2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
module Members
|
|
|
|
class UpdateService < Members::BaseService
|
|
|
|
# returns the updated member
|
|
|
|
def execute(member, permission: :update)
|
|
|
|
raise Gitlab::Access::AccessDeniedError unless can?(current_user, action_member_permission(permission, member), member)
|
|
|
|
|
|
|
|
old_access_level = member.human_access
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
if member.update(params)
|
2018-03-27 19:54:05 +05:30
|
|
|
after_execute(action: permission, old_access_level: old_access_level, member: member)
|
|
|
|
end
|
|
|
|
|
|
|
|
member
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|