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
152f5743
Commit
152f5743
authored
Mar 03, 2021
by
Serena Fang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'sfang-do-not-show-token-name' into 'master'"
This reverts merge request !54022
parent
cbd41c03
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
30 deletions
+2
-30
changelogs/unreleased/sfang-do-not-show-token-name.yml
changelogs/unreleased/sfang-do-not-show-token-name.yml
+0
-5
lib/api/entities/user_safe.rb
lib/api/entities/user_safe.rb
+1
-2
spec/features/projects/members/list_spec.rb
spec/features/projects/members/list_spec.rb
+1
-1
spec/lib/api/entities/user_spec.rb
spec/lib/api/entities/user_spec.rb
+0
-18
spec/support/helpers/features/members_table_helpers.rb
spec/support/helpers/features/members_table_helpers.rb
+0
-4
No files found.
changelogs/unreleased/sfang-do-not-show-token-name.yml
deleted
100644 → 0
View file @
cbd41c03
---
title
:
Do not expose user name if user is project bot
merge_request
:
54022
author
:
type
:
changed
lib/api/entities/user_safe.rb
View file @
152f5743
...
@@ -3,8 +3,7 @@
...
@@ -3,8 +3,7 @@
module
API
module
API
module
Entities
module
Entities
class
UserSafe
<
Grape
::
Entity
class
UserSafe
<
Grape
::
Entity
expose
:id
,
:username
expose
:id
,
:name
,
:username
expose
:name
,
unless:
->
(
user
)
{
user
.
project_bot?
&&
!
options
[
:current_user
].
admin?
}
end
end
end
end
end
end
spec/features/projects/members/list_spec.rb
View file @
152f5743
...
@@ -127,7 +127,7 @@ RSpec.describe 'Project members list' do
...
@@ -127,7 +127,7 @@ RSpec.describe 'Project members list' do
it
'does not show form used to change roles and "Expiration date" or the remove user button'
do
it
'does not show form used to change roles and "Expiration date" or the remove user button'
do
visit_members_page
visit_members_page
page
.
within
find_
username
_row
(
project_bot
)
do
page
.
within
find_
member
_row
(
project_bot
)
do
expect
(
page
).
not_to
have_button
(
'Maintainer'
)
expect
(
page
).
not_to
have_button
(
'Maintainer'
)
expect
(
page
).
to
have_field
(
'Expiration date'
,
disabled:
true
)
expect
(
page
).
to
have_field
(
'Expiration date'
,
disabled:
true
)
expect
(
page
).
not_to
have_button
(
'Remove member'
)
expect
(
page
).
not_to
have_button
(
'Remove member'
)
...
...
spec/lib/api/entities/user_spec.rb
View file @
152f5743
...
@@ -35,22 +35,4 @@ RSpec.describe API::Entities::User do
...
@@ -35,22 +35,4 @@ RSpec.describe API::Entities::User do
expect
(
subject
[
:bot
]).
to
eq
(
true
)
expect
(
subject
[
:bot
]).
to
eq
(
true
)
end
end
end
end
context
'with project bot user'
do
let
(
:user
)
{
create
(
:user
,
:project_bot
)
}
context
'when the requester is not an admin'
do
it
'does not expose project bot user name'
do
expect
(
subject
).
not_to
include
(
:name
)
end
end
context
'when the requester is an admin'
do
let
(
:current_user
)
{
create
(
:user
,
:admin
)
}
it
'exposes project bot user name'
do
expect
(
subject
).
to
include
(
:name
)
end
end
end
end
end
spec/support/helpers/features/members_table_helpers.rb
View file @
152f5743
...
@@ -41,10 +41,6 @@ module Spec
...
@@ -41,10 +41,6 @@ module Spec
find_row
(
user
.
name
)
find_row
(
user
.
name
)
end
end
def
find_username_row
(
user
)
find_row
(
user
.
username
)
end
def
find_invited_member_row
(
email
)
def
find_invited_member_row
(
email
)
find_row
(
email
)
find_row
(
email
)
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