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
fae14a7b
Commit
fae14a7b
authored
May 06, 2021
by
Serena Fang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move expose is auditor to EE
Since auditor users are EE only, move expose is auditor to EE file
parent
66aae34b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
15 deletions
+14
-15
ee/lib/ee/api/entities/user_with_admin.rb
ee/lib/ee/api/entities/user_with_admin.rb
+1
-0
ee/spec/lib/ee/api/entities/user_with_admin_spec.rb
ee/spec/lib/ee/api/entities/user_with_admin_spec.rb
+13
-0
lib/api/entities/user_with_admin.rb
lib/api/entities/user_with_admin.rb
+0
-1
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+0
-14
No files found.
ee/lib/ee/api/entities/user_with_admin.rb
View file @
fae14a7b
...
...
@@ -8,6 +8,7 @@ module EE
prepended
do
expose
:using_license_seat?
,
as: :using_license_seat
expose
:auditor
,
as: :is_auditor
end
end
end
...
...
ee/spec/lib/ee/api/entities/user_with_admin_spec.rb
View file @
fae14a7b
...
...
@@ -23,4 +23,17 @@ RSpec.describe ::EE::API::Entities::UserWithAdmin do
end
end
end
context
'is_auditor'
do
it
'returns false when user is not an auditor'
do
expect
(
subject
[
:is_auditor
]).
to
be
false
end
context
'when user is an auditor'
do
let
(
:user
)
{
create
(
:user
,
:auditor
)
}
it
'returns true'
do
expect
(
subject
[
:is_auditor
]).
to
be
true
end
end
end
end
lib/api/entities/user_with_admin.rb
View file @
fae14a7b
...
...
@@ -4,7 +4,6 @@ module API
module
Entities
class
UserWithAdmin
<
UserPublic
expose
:admin?
,
as: :is_admin
expose
:auditor
,
as: :is_auditor
expose
:note
end
end
...
...
spec/requests/api/users_spec.rb
View file @
fae14a7b
...
...
@@ -536,13 +536,6 @@ RSpec.describe API::Users do
expect
(
json_response
.
keys
).
not_to
include
'is_admin'
end
it
"does not return the user's `is_auditor` flag"
do
get
api
(
"/users/
#{
user
.
id
}
"
,
user
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/user/basic'
)
expect
(
json_response
.
keys
).
not_to
include
'is_auditor'
end
it
"does not return the user's `highest_role`"
do
get
api
(
"/users/
#{
user
.
id
}
"
,
user
)
...
...
@@ -589,13 +582,6 @@ RSpec.describe API::Users do
expect
(
json_response
[
'is_admin'
]).
to
be
(
false
)
end
it
'includes the `is_auditor` field'
do
get
api
(
"/users/
#{
user
.
id
}
"
,
admin
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/user/admin'
)
expect
(
json_response
[
'is_auditor'
]).
to
be
(
false
)
end
it
"includes the `created_at` field for private users"
do
get
api
(
"/users/
#{
private_user
.
id
}
"
,
admin
)
...
...
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