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
a68e0b6a
Commit
a68e0b6a
authored
Oct 02, 2020
by
Amparo Luna
Committed by
Gabriel Mazetto
Oct 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose using_license_seat in users API for admins
parent
f751d0f8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
0 deletions
+48
-0
ee/changelogs/unreleased/al-36750-expose-using-license-for-admin-users-api.yml
...sed/al-36750-expose-using-license-for-admin-users-api.yml
+5
-0
ee/lib/ee/api/entities/user_with_admin.rb
ee/lib/ee/api/entities/user_with_admin.rb
+15
-0
ee/spec/lib/ee/api/entities/user_with_admin_spec.rb
ee/spec/lib/ee/api/entities/user_with_admin_spec.rb
+26
-0
lib/api/entities/user_with_admin.rb
lib/api/entities/user_with_admin.rb
+2
-0
No files found.
ee/changelogs/unreleased/al-36750-expose-using-license-for-admin-users-api.yml
0 → 100644
View file @
a68e0b6a
---
title
:
Expose using_license_seat in users API for admins
merge_request
:
43057
author
:
type
:
added
ee/lib/ee/api/entities/user_with_admin.rb
0 → 100644
View file @
a68e0b6a
# frozen_string_literal: true
module
EE
module
API
module
Entities
module
UserWithAdmin
extend
ActiveSupport
::
Concern
prepended
do
expose
:using_license_seat?
,
as: :using_license_seat
end
end
end
end
end
ee/spec/lib/ee/api/entities/user_with_admin_spec.rb
0 → 100644
View file @
a68e0b6a
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
::
EE
::
API
::
Entities
::
UserWithAdmin
do
subject
{
entity
.
as_json
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:entity
)
{
::
API
::
Entities
::
UserWithAdmin
.
new
(
user
)
}
context
'using_license_seat'
do
context
'when user is using seat'
do
it
'returns true'
do
expect
(
subject
[
:using_license_seat
]).
to
be
true
end
end
context
'when user is not using seat'
do
it
'returns false'
do
allow
(
user
).
to
receive
(
:using_license_seat?
).
and_return
(
false
)
expect
(
subject
[
:using_license_seat
]).
to
be
false
end
end
end
end
lib/api/entities/user_with_admin.rb
View file @
a68e0b6a
...
...
@@ -8,3 +8,5 @@ module API
end
end
end
API
::
Entities
::
UserWithAdmin
.
prepend_if_ee
(
'EE::API::Entities::UserWithAdmin'
)
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