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
5da9bfa4
Commit
5da9bfa4
authored
Nov 11, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test for GitAccessWiki, it's overriding change_access_check
parent
40632455
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+6
-3
lib/gitlab/git_access_wiki.rb
lib/gitlab/git_access_wiki.rb
+1
-1
No files found.
lib/gitlab/git_access.rb
View file @
5da9bfa4
...
@@ -138,9 +138,7 @@ module Gitlab
...
@@ -138,9 +138,7 @@ module Gitlab
# Iterate over all changes to find if user allowed all of them to be applied
# Iterate over all changes to find if user allowed all of them to be applied
changes_list
.
each
do
|
change
|
changes_list
.
each
do
|
change
|
status
=
Checks
::
ChangeAccess
.
new
(
change
,
status
=
check_single_change_access
(
change
)
user_access:
user_access
,
project:
project
).
exec
unless
status
.
allowed?
unless
status
.
allowed?
# If user does not have access to make at least one change - cancel all push
# If user does not have access to make at least one change - cancel all push
raise
UnauthorizedError
,
status
.
message
raise
UnauthorizedError
,
status
.
message
...
@@ -148,6 +146,11 @@ module Gitlab
...
@@ -148,6 +146,11 @@ module Gitlab
end
end
end
end
def
check_single_change_access
(
change
)
Checks
::
ChangeAccess
.
new
(
change
,
user_access:
user_access
,
project:
project
).
exec
end
def
matching_merge_request?
(
newrev
,
branch_name
)
def
matching_merge_request?
(
newrev
,
branch_name
)
Checks
::
MatchingMergeRequest
.
new
(
newrev
,
branch_name
,
project
).
match?
Checks
::
MatchingMergeRequest
.
new
(
newrev
,
branch_name
,
project
).
match?
end
end
...
...
lib/gitlab/git_access_wiki.rb
View file @
5da9bfa4
module
Gitlab
module
Gitlab
class
GitAccessWiki
<
GitAccess
class
GitAccessWiki
<
GitAccess
def
ch
ange_access_check
(
change
)
def
ch
eck_single_change_access
(
change
)
if
user_access
.
can_do_action?
(
:create_wiki
)
if
user_access
.
can_do_action?
(
:create_wiki
)
build_status_object
(
true
)
build_status_object
(
true
)
else
else
...
...
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