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
d3a629a9
Commit
d3a629a9
authored
Nov 23, 2019
by
Thiago Presa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Users without projects use a license seat in a non-premium license
parent
56a7cabe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
changelogs/unreleased/tpresa-user-without-project-license-seat.yml
...s/unreleased/tpresa-user-without-project-license-seat.yml
+5
-0
ee/app/models/ee/user.rb
ee/app/models/ee/user.rb
+1
-1
ee/spec/models/user_spec.rb
ee/spec/models/user_spec.rb
+18
-2
No files found.
changelogs/unreleased/tpresa-user-without-project-license-seat.yml
0 → 100644
View file @
d3a629a9
---
title
:
Users without projects use a license seat in a non-premium license
merge_request
:
20664
author
:
type
:
fixed
ee/app/models/ee/user.rb
View file @
d3a629a9
...
...
@@ -279,7 +279,7 @@ module EE
if
License
.
current
&
.
exclude_guests_from_active_count?
highest_role
>
::
Gitlab
::
Access
::
GUEST
else
highest_role
>
::
Gitlab
::
Access
::
NO_ACCESS
true
end
end
...
...
ee/spec/models/user_spec.rb
View file @
d3a629a9
...
...
@@ -626,9 +626,9 @@ describe User do
end
context
'when user is active'
do
let
(
:project_guest_user
)
{
create
(
:project_member
,
:guest
).
user
}
context
'user is guest'
do
let
(
:project_guest_user
)
{
create
(
:project_member
,
:guest
).
user
}
it
'returns false if license is ultimate'
do
create
(
:license
,
plan:
License
::
ULTIMATE_PLAN
)
...
...
@@ -641,6 +641,22 @@ describe User do
expect
(
project_guest_user
.
using_license_seat?
).
to
eq
true
end
end
context
'user is admin without projects'
do
let
(
:user
)
{
create
(
:user
,
admin:
true
)
}
it
'returns false if license is ultimate'
do
create
(
:license
,
plan:
License
::
ULTIMATE_PLAN
)
expect
(
user
.
using_license_seat?
).
to
eq
false
end
it
'returns true if license is not ultimate'
do
create
(
:license
,
plan:
License
::
STARTER_PLAN
)
expect
(
user
.
using_license_seat?
).
to
eq
true
end
end
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