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
9e0dffa3
Commit
9e0dffa3
authored
Aug 06, 2018
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Geo pull/push checks into EE GitAccess spec
parent
58d7871a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
ee/spec/lib/gitlab/git_access_spec.rb
ee/spec/lib/gitlab/git_access_spec.rb
+11
-0
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+0
-7
No files found.
ee/spec/lib/gitlab/git_access_spec.rb
View file @
9e0dffa3
...
...
@@ -264,12 +264,23 @@ For more information: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}"
end
end
describe
'Geo system permissions'
do
let
(
:actor
)
{
:geo
}
it
{
expect
{
pull_changes
}.
not_to
raise_error
}
it
{
expect
{
push_changes
}.
to
raise_unauthorized
(
Gitlab
::
GitAccess
::
ERROR_MESSAGES
[
:upload
])
}
end
private
def
push_changes
(
changes
=
'_any'
)
access
.
check
(
'git-receive-pack'
,
changes
)
end
def
pull_changes
(
changes
=
'_any'
)
access
.
check
(
'git-upload-pack'
,
changes
)
end
def
raise_unauthorized
(
message
)
raise_error
(
Gitlab
::
GitAccess
::
UnauthorizedError
,
message
)
end
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
9e0dffa3
...
...
@@ -1165,13 +1165,6 @@ describe Gitlab::GitAccess do
end
end
describe
'Geo system permissions'
do
let
(
:actor
)
{
:geo
}
it
{
expect
{
pull_access_check
}.
not_to
raise_error
}
it
{
expect
{
push_access_check
}.
to
raise_unauthorized
(
Gitlab
::
GitAccess
::
ERROR_MESSAGES
[
:upload
])
}
end
context
'terms are enforced'
do
before
do
enforce_terms
...
...
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