Commit d24f3b6b authored by serenafang's avatar serenafang

Add post create hook method

parent 88d9a031
......@@ -510,5 +510,14 @@ module EE
def invited_or_shared_group_members(groups)
::GroupMember.active_without_invites_and_requests.where(source_id: ::Gitlab::ObjectHierarchy.new(groups).base_and_ancestors)
end
def execute_hooks(data, hooks_scope)
return unless feature_available?(:group_webhooks)
self_and_ancestor_hooks = GroupHook.where(group_id: self.self_and_ancestors)
self_and_ancestor_hooks.hooks_for(hooks_scope).each do |hook|
hook.async_execute(data, hooks_scope.to_s)
end
end
end
end
......@@ -108,5 +108,10 @@ module EE
allowed_email_domain.email_matches_domain?(email)
end
end
def post_create_hook
add_group_member_data = Gitlab::HookData::GroupMemberBuilder
self.source.execute_hooks(add_group_member_data, :member_hooks)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment