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
5428e3ab
Commit
5428e3ab
authored
Sep 01, 2020
by
Małgorzata Ksionek
Committed by
Jan Provaznik
Sep 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not show unassigned members on admin group page
Update admin views Add specs for group Fix little things Fix Fix
parent
b04dd44f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
17 deletions
+43
-17
app/controllers/admin/groups_controller.rb
app/controllers/admin/groups_controller.rb
+5
-1
app/models/group.rb
app/models/group.rb
+4
-0
app/views/admin/groups/_group.html.haml
app/views/admin/groups/_group.html.haml
+1
-1
ee/app/models/ee/group_member.rb
ee/app/models/ee/group_member.rb
+0
-3
ee/app/presenters/ee/member_presenter.rb
ee/app/presenters/ee/member_presenter.rb
+0
-7
ee/spec/models/group_spec.rb
ee/spec/models/group_spec.rb
+28
-0
lib/gitlab/access.rb
lib/gitlab/access.rb
+4
-4
spec/services/authorized_project_update/project_group_link_create_service_spec.rb
..._project_update/project_group_link_create_service_spec.rb
+1
-1
No files found.
app/controllers/admin/groups_controller.rb
View file @
5428e3ab
...
@@ -19,7 +19,7 @@ class Admin::GroupsController < Admin::ApplicationController
...
@@ -19,7 +19,7 @@ class Admin::GroupsController < Admin::ApplicationController
# the Group with statistics).
# the Group with statistics).
@group
=
Group
.
with_statistics
.
find
(
group
&
.
id
)
@group
=
Group
.
with_statistics
.
find
(
group
&
.
id
)
@members
=
present_members
(
@members
=
present_members
(
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:members_page
]))
group_
members
.
order
(
"access_level DESC"
).
page
(
params
[
:members_page
]))
@requesters
=
present_members
(
@requesters
=
present_members
(
AccessRequestsFinder
.
new
(
@group
).
execute
(
current_user
))
AccessRequestsFinder
.
new
(
@group
).
execute
(
current_user
))
@projects
=
@group
.
projects
.
with_statistics
.
page
(
params
[
:projects_page
])
@projects
=
@group
.
projects
.
with_statistics
.
page
(
params
[
:projects_page
])
...
@@ -82,6 +82,10 @@ class Admin::GroupsController < Admin::ApplicationController
...
@@ -82,6 +82,10 @@ class Admin::GroupsController < Admin::ApplicationController
@group
||=
Group
.
find_by_full_path
(
params
[
:id
])
@group
||=
Group
.
find_by_full_path
(
params
[
:id
])
end
end
def
group_members
@group
.
members
.
non_unassigned
end
def
group_params
def
group_params
params
.
require
(
:group
).
permit
(
allowed_group_params
)
params
.
require
(
:group
).
permit
(
allowed_group_params
)
end
end
...
...
app/models/group.rb
View file @
5428e3ab
...
@@ -397,6 +397,10 @@ class Group < Namespace
...
@@ -397,6 +397,10 @@ class Group < Namespace
])
])
end
end
def
users_count
members
.
non_unassigned
.
count
end
# Returns all users that are members of projects
# Returns all users that are members of projects
# belonging to the current group or sub-groups
# belonging to the current group or sub-groups
def
project_users_with_descendants
def
project_users_with_descendants
...
...
app/views/admin/groups/_group.html.haml
View file @
5428e3ab
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
%span
.gl-ml-5
%span
.gl-ml-5
=
sprite_icon
(
'users'
,
css_class:
'gl-vertical-align-text-bottom'
)
=
sprite_icon
(
'users'
,
css_class:
'gl-vertical-align-text-bottom'
)
=
number_with_delimiter
(
group
.
users
.
count
)
=
number_with_delimiter
(
group
.
users
_
count
)
%span
.gl-ml-5.visibility-icon.has-tooltip
{
data:
{
container:
'body'
,
placement:
'left'
},
title:
visibility_icon_description
(
group
)
}
%span
.gl-ml-5.visibility-icon.has-tooltip
{
data:
{
container:
'body'
,
placement:
'left'
},
title:
visibility_icon_description
(
group
)
}
=
visibility_level_icon
(
group
.
visibility_level
)
=
visibility_level_icon
(
group
.
visibility_level
)
...
...
ee/app/models/ee/group_member.rb
View file @
5428e3ab
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
module
EE
module
EE
module
GroupMember
module
GroupMember
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
extend
::
Gitlab
::
Utils
::
Override
prepended
do
prepended
do
extend
::
Gitlab
::
Utils
::
Override
extend
::
Gitlab
::
Utils
::
Override
...
@@ -27,8 +26,6 @@ module EE
...
@@ -27,8 +26,6 @@ module EE
end
end
class_methods
do
class_methods
do
extend
::
Gitlab
::
Utils
::
Override
def
member_of_group?
(
group
,
user
)
def
member_of_group?
(
group
,
user
)
exists?
(
group:
group
,
user:
user
)
exists?
(
group:
group
,
user:
user
)
end
end
...
...
ee/app/presenters/ee/member_presenter.rb
View file @
5428e3ab
...
@@ -13,13 +13,6 @@ module EE
...
@@ -13,13 +13,6 @@ module EE
can?
(
current_user
,
override_member_permission
,
member
)
can?
(
current_user
,
override_member_permission
,
member
)
end
end
override
:valid_level_roles
def
valid_level_roles
return
super
if
member
.
source
.
is_a?
(
Project
)
super
.
except
(
"Unassigned"
)
end
private
private
def
override_member_permission
def
override_member_permission
...
...
ee/spec/models/group_spec.rb
View file @
5428e3ab
...
@@ -668,6 +668,34 @@ RSpec.describe Group do
...
@@ -668,6 +668,34 @@ RSpec.describe Group do
end
end
end
end
describe
'#unassigned_role_allowed?'
do
subject
{
group
.
unassigned_role_allowed?
}
context
'licensed'
do
before
do
stub_licensed_features
(
unassigned_role:
true
)
end
it
'returns true for licensed instance'
do
is_expected
.
to
be
true
end
it
'returns false for subgroup in licensed instance'
do
expect
(
create
(
:group
,
parent:
group
).
unassigned_role_allowed?
).
to
be
false
end
end
context
'unlicensed'
do
before
do
stub_licensed_features
(
unassigned_role:
false
)
end
it
'returns false unlicensed instance'
do
is_expected
.
to
be
false
end
end
end
describe
'#saml_discovery_token'
do
describe
'#saml_discovery_token'
do
it
'returns existing tokens'
do
it
'returns existing tokens'
do
group
=
create
(
:group
,
saml_discovery_token:
'existing'
)
group
=
create
(
:group
,
saml_discovery_token:
'existing'
)
...
...
lib/gitlab/access.rb
View file @
5428e3ab
spec/services/authorized_project_update/project_group_link_create_service_spec.rb
View file @
5428e3ab
...
@@ -112,7 +112,7 @@ RSpec.describe AuthorizedProjectUpdate::ProjectGroupLinkCreateService do
...
@@ -112,7 +112,7 @@ RSpec.describe AuthorizedProjectUpdate::ProjectGroupLinkCreateService do
end
end
end
end
context
'una
pproved access requests
'
do
context
'una
ssigned member
'
do
before
do
before
do
create
(
:group_member
,
:unassigned
,
user:
group_user
,
group:
group
)
create
(
:group_member
,
:unassigned
,
user:
group_user
,
group:
group
)
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