Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d24f3b6b
Commit
d24f3b6b
authored
Dec 10, 2020
by
serenafang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add post create hook method
parent
88d9a031
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
ee/app/models/ee/group.rb
ee/app/models/ee/group.rb
+9
-0
ee/app/models/ee/group_member.rb
ee/app/models/ee/group_member.rb
+5
-0
No files found.
ee/app/models/ee/group.rb
View file @
d24f3b6b
...
...
@@ -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
ee/app/models/ee/group_member.rb
View file @
d24f3b6b
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment