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
4ce8718a
Commit
4ce8718a
authored
Oct 12, 2021
by
Sheldon Led
Committed by
Etienne Baqué
Oct 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pending SaaS users to "Invited" members tab [RUN AS-IF-FOSS]
parent
309f6cd0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
12 deletions
+57
-12
app/controllers/groups/group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+16
-6
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+16
-6
ee/app/controllers/ee/groups/group_members_controller.rb
ee/app/controllers/ee/groups/group_members_controller.rb
+10
-0
ee/app/controllers/ee/projects/project_members_controller.rb
ee/app/controllers/ee/projects/project_members_controller.rb
+13
-0
ee/app/models/ee/member.rb
ee/app/models/ee/member.rb
+2
-0
No files found.
app/controllers/groups/group_members_controller.rb
View file @
4ce8718a
...
...
@@ -25,19 +25,15 @@ class Groups::GroupMembersController < Groups::ApplicationController
def
index
@sort
=
params
[
:sort
].
presence
||
sort_value_name
@members
=
GroupMembersFinder
.
new
(
@group
,
current_user
,
params:
filter_params
)
.
execute
(
include_relations:
requested_relations
)
if
can?
(
current_user
,
:admin_group_member
,
@group
)
@skip_groups
=
@group
.
related_group_ids
@invited_members
=
@members
.
invite
@invited_members
=
invited_members
@invited_members
=
@invited_members
.
search_invite_email
(
params
[
:search_invited
])
if
params
[
:search_invited
].
present?
@invited_members
=
present_invited_members
(
@invited_members
)
end
@members
=
present_group_members
(
@members
.
non_invite
)
@members
=
present_group_members
(
non_invited_members
)
@requesters
=
present_members
(
AccessRequestsFinder
.
new
(
@group
).
execute
(
current_user
)
...
...
@@ -51,6 +47,20 @@ class Groups::GroupMembersController < Groups::ApplicationController
private
def
group_members
@group_members
||=
GroupMembersFinder
.
new
(
@group
,
current_user
,
params:
filter_params
)
.
execute
(
include_relations:
requested_relations
)
end
def
invited_members
group_members
.
invite
end
def
non_invited_members
group_members
.
non_invite
end
def
present_invited_members
(
invited_members
)
present_members
(
invited_members
.
page
(
params
[
:invited_members_page
])
...
...
app/controllers/projects/project_members_controller.rb
View file @
4ce8718a
...
...
@@ -19,16 +19,12 @@ class Projects::ProjectMembersController < Projects::ApplicationController
@group_links
=
@project
.
project_group_links
@group_links
=
@group_links
.
search
(
params
[
:search_groups
])
if
params
[
:search_groups
].
present?
project_members
=
MembersFinder
.
new
(
@project
,
current_user
,
params:
filter_params
)
.
execute
(
include_relations:
requested_relations
)
if
can?
(
current_user
,
:admin_project_member
,
@project
)
@invited_members
=
present_members
(
project_members
.
invite
)
@invited_members
=
present_members
(
invited_members
)
@requesters
=
present_members
(
AccessRequestsFinder
.
new
(
@project
).
execute
(
current_user
))
end
@project_members
=
present_members
(
project_members
.
non_invite
.
page
(
params
[
:page
]))
@project_members
=
present_members
(
non_invited_members
.
page
(
params
[
:page
]))
@project_member
=
@project
.
project_members
.
new
end
...
...
@@ -55,6 +51,20 @@ class Projects::ProjectMembersController < Projects::ApplicationController
private
def
members
@members
||=
MembersFinder
.
new
(
@project
,
current_user
,
params:
filter_params
)
.
execute
(
include_relations:
requested_relations
)
end
def
invited_members
members
.
invite
end
def
non_invited_members
members
.
non_invite
end
def
filter_params
params
.
permit
(
:search
).
merge
(
sort:
@sort
)
end
...
...
ee/app/controllers/ee/groups/group_members_controller.rb
View file @
4ce8718a
...
...
@@ -53,6 +53,16 @@ module EE
protected
override
:invited_members
def
invited_members
super
.
or
(
group_members
.
awaiting
)
end
override
:non_invited_members
def
non_invited_members
super
.
non_awaiting
end
def
authorize_update_group_member!
unless
can?
(
current_user
,
:admin_group_member
,
group
)
||
can?
(
current_user
,
:override_group_member
,
group
)
render_403
...
...
ee/app/controllers/ee/projects/project_members_controller.rb
View file @
4ce8718a
...
...
@@ -4,6 +4,7 @@ module EE
module
Projects
module
ProjectMembersController
extend
ActiveSupport
::
Concern
extend
::
Gitlab
::
Utils
::
Override
prepended
do
before_action
:check_membership_lock!
,
only:
[
:create
,
:import
,
:apply_import
]
...
...
@@ -12,6 +13,18 @@ module EE
def
check_membership_lock!
access_denied!
(
'Membership is locked by group settings'
)
if
membership_locked?
end
protected
override
:invited_members
def
invited_members
super
.
or
(
members
.
awaiting
)
end
override
:non_invited_members
def
non_invited_members
super
.
non_awaiting
end
end
end
end
ee/app/models/ee/member.rb
View file @
4ce8718a
...
...
@@ -25,6 +25,8 @@ module EE
state
:awaiting
,
value:
STATE_AWAITING
state
:active
,
value:
STATE_ACTIVE
end
scope
:awaiting
,
->
{
where
(
state:
STATE_AWAITING
)}
scope
:non_awaiting
,
->
{
where
.
not
(
state:
STATE_AWAITING
)}
before_create
:set_membership_activation
...
...
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