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
95197a13
Commit
95197a13
authored
Jun 21, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix remaining DotPosition cops
Introduced in
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2201
parent
8038cdac
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
29 deletions
+29
-29
app/finders/events_finder.rb
app/finders/events_finder.rb
+2
-2
app/models/project.rb
app/models/project.rb
+8
-8
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+2
-2
spec/lib/gitlab/ee/visibility_level_spec.rb
spec/lib/gitlab/ee/visibility_level_spec.rb
+4
-4
spec/lib/gitlab/visibility_level_spec.rb
spec/lib/gitlab/visibility_level_spec.rb
+11
-11
spec/requests/git_http_spec.rb
spec/requests/git_http_spec.rb
+2
-2
No files found.
app/finders/events_finder.rb
View file @
95197a13
...
...
@@ -33,8 +33,8 @@ class EventsFinder
private
def
by_current_user_access
(
events
)
events
.
merge
(
ProjectsFinder
.
new
(
current_user:
current_user
).
execute
)
.
joins
(
:project
)
events
.
merge
(
ProjectsFinder
.
new
(
current_user:
current_user
).
execute
)
.
joins
(
:project
)
end
def
by_action
(
events
)
...
...
app/models/project.rb
View file @
95197a13
...
...
@@ -275,10 +275,10 @@ class Project < ActiveRecord::Base
# logged in user.
def
self
.
public_or_visible_to_user
(
user
=
nil
)
if
user
authorized
=
user
.
project_authorizations
.
select
(
1
).
where
(
'project_authorizations.project_id = projects.id'
)
authorized
=
user
.
project_authorizations
.
select
(
1
)
.
where
(
'project_authorizations.project_id = projects.id'
)
levels
=
Gitlab
::
VisibilityLevel
.
levels_for_user
(
user
)
...
...
@@ -303,11 +303,11 @@ class Project < ActiveRecord::Base
elsif
user
column
=
ProjectFeature
.
quoted_access_level_column
(
feature
)
authorized
=
user
.
project_authorizations
.
select
(
1
)
.
where
(
'project_authorizations.project_id = projects.id'
)
authorized
=
user
.
project_authorizations
.
select
(
1
)
.
where
(
'project_authorizations.project_id = projects.id'
)
with_project_feature
.
where
(
"
#{
column
}
IN (?) OR (
#{
column
}
= ? AND EXISTS (?))"
,
with_project_feature
.
where
(
"
#{
column
}
IN (?) OR (
#{
column
}
= ? AND EXISTS (?))"
,
visible
,
ProjectFeature
::
PRIVATE
,
authorized
)
...
...
spec/controllers/projects_controller_spec.rb
View file @
95197a13
...
...
@@ -176,8 +176,8 @@ describe ProjectsController do
context
'project repo over limit'
do
before
do
allow_any_instance_of
(
EE
::
Project
)
.
to
receive
(
:above_size_limit?
).
and_return
(
true
)
allow_any_instance_of
(
EE
::
Project
)
.
to
receive
(
:above_size_limit?
).
and_return
(
true
)
project
.
team
<<
[
user
,
:master
]
end
...
...
spec/lib/gitlab/ee/visibility_level_spec.rb
View file @
95197a13
...
...
@@ -5,8 +5,8 @@ describe Gitlab::VisibilityLevel, lib: true do # rubocop:disable RSpec/FilePath
it
'returns all levels for an auditor'
do
user
=
build
(
:user
,
:auditor
)
expect
(
described_class
.
levels_for_user
(
user
))
.
to
eq
([
Gitlab
::
VisibilityLevel
::
PRIVATE
,
expect
(
described_class
.
levels_for_user
(
user
))
.
to
eq
([
Gitlab
::
VisibilityLevel
::
PRIVATE
,
Gitlab
::
VisibilityLevel
::
INTERNAL
,
Gitlab
::
VisibilityLevel
::
PUBLIC
])
end
...
...
spec/lib/gitlab/visibility_level_spec.rb
View file @
95197a13
...
...
@@ -23,8 +23,8 @@ describe Gitlab::VisibilityLevel, lib: true do
it
'returns all levels for an admin'
do
user
=
build
(
:user
,
:admin
)
expect
(
described_class
.
levels_for_user
(
user
))
.
to
eq
([
Gitlab
::
VisibilityLevel
::
PRIVATE
,
expect
(
described_class
.
levels_for_user
(
user
))
.
to
eq
([
Gitlab
::
VisibilityLevel
::
PRIVATE
,
Gitlab
::
VisibilityLevel
::
INTERNAL
,
Gitlab
::
VisibilityLevel
::
PUBLIC
])
end
...
...
@@ -32,21 +32,21 @@ describe Gitlab::VisibilityLevel, lib: true do
it
'returns INTERNAL and PUBLIC for internal users'
do
user
=
build
(
:user
)
expect
(
described_class
.
levels_for_user
(
user
))
.
to
eq
([
Gitlab
::
VisibilityLevel
::
INTERNAL
,
expect
(
described_class
.
levels_for_user
(
user
))
.
to
eq
([
Gitlab
::
VisibilityLevel
::
INTERNAL
,
Gitlab
::
VisibilityLevel
::
PUBLIC
])
end
it
'returns PUBLIC for external users'
do
user
=
build
(
:user
,
:external
)
expect
(
described_class
.
levels_for_user
(
user
))
.
to
eq
([
Gitlab
::
VisibilityLevel
::
PUBLIC
])
expect
(
described_class
.
levels_for_user
(
user
))
.
to
eq
([
Gitlab
::
VisibilityLevel
::
PUBLIC
])
end
it
'returns PUBLIC when no user is given'
do
expect
(
described_class
.
levels_for_user
)
.
to
eq
([
Gitlab
::
VisibilityLevel
::
PUBLIC
])
expect
(
described_class
.
levels_for_user
)
.
to
eq
([
Gitlab
::
VisibilityLevel
::
PUBLIC
])
end
end
end
spec/requests/git_http_spec.rb
View file @
95197a13
...
...
@@ -768,8 +768,8 @@ describe 'Git HTTP requests', lib: true do
end
it
'responds with status 403 Forbidden'
do
allow_any_instance_of
(
EE
::
Project
)
.
to
receive
(
:above_size_limit?
).
and_return
(
true
)
allow_any_instance_of
(
EE
::
Project
)
.
to
receive
(
:above_size_limit?
).
and_return
(
true
)
upload
(
path
,
env
)
do
|
response
|
expect
(
response
).
to
have_http_status
(
:forbidden
)
...
...
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