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
f549b01a
Commit
f549b01a
authored
Jun 07, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conflicts in Gitlab::GitAccessWiki and specs
parent
ab65d03b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
15 deletions
+6
-15
lib/gitlab/git_access_wiki.rb
lib/gitlab/git_access_wiki.rb
+4
-8
spec/lib/gitlab/git_access_wiki_spec.rb
spec/lib/gitlab/git_access_wiki_spec.rb
+2
-7
No files found.
lib/gitlab/git_access_wiki.rb
View file @
f549b01a
module
Gitlab
class
GitAccessWiki
<
GitAccess
ERROR_MESSAGES
=
{
geo:
"You can't push code to a secondary GitLab Geo node."
,
write_to_wiki:
"You are not allowed to write to this project's wiki."
}.
freeze
...
...
@@ -13,17 +14,12 @@ module Gitlab
end
def
check_single_change_access
(
change
)
<<<<<<<
HEAD
if
Gitlab
::
Geo
.
enabled?
&&
Gitlab
::
Geo
.
secondary?
build_status_object
(
false
,
"You can't push code to a secondary GitLab Geo node."
)
elsif
user_access
.
can_do_action?
(
:create_wiki
)
build_status_object
(
true
)
else
build_status_object
(
false
,
"You are not allowed to write to this project's wiki."
)
=======
raise
UnauthorizedError
,
ERROR_MESSAGES
[
:geo
]
end
unless
user_access
.
can_do_action?
(
:create_wiki
)
raise
UnauthorizedError
,
ERROR_MESSAGES
[
:write_to_wiki
]
>>>>>>>
ce
/
master
end
true
...
...
spec/lib/gitlab/git_access_wiki_spec.rb
View file @
f549b01a
...
...
@@ -22,20 +22,15 @@ describe Gitlab::GitAccessWiki, lib: true do
subject
{
access
.
check
(
'git-receive-pack'
,
changes
)
}
<<<<<<<
HEAD
it
{
expect
(
subject
.
allowed?
).
to
be_truthy
}
it
{
expect
{
subject
}.
not_to
raise_error
}
context
'when in a secondary gitlab geo node'
do
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:enabled?
)
{
true
}
allow
(
Gitlab
::
Geo
).
to
receive
(
:secondary?
)
{
true
}
end
=======
it
{
expect
{
subject
}.
not_to
raise_error
}
end
>>>>>>>
ce
/
master
it
{
expect
(
subject
.
allowed?
).
to
be_falsey
}
it
{
expect
{
subject
}.
to
raise_error
(
Gitlab
::
GitAccess
::
UnauthorizedError
,
"You can't push code to a secondary GitLab Geo node."
)
}
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