BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
git_access.rb
lib/gitlab/git_access.rb
+6
-3
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
# Iterate over all changes to find if user allowed all of them to be applied
changes_list
.
each
do
|
change
|
status
=
Checks
::
ChangeAccess
.
new
(
change
,
user_access:
user_access
,
project:
project
).
exec
status
=
check_single_change_access
(
change
)
unless
status
.
allowed?
# If user does not have access to make at least one change - cancel all push
raise
UnauthorizedError
,
status
.
message
...
...
@@ -148,6 +146,11 @@ module Gitlab
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
)
Checks
::
MatchingMergeRequest
.
new
(
newrev
,
branch_name
,
project
).
match?
end
...
...
lib/gitlab/git_access_wiki.rb
View file @
5da9bfa4
module
Gitlab
class
GitAccessWiki
<
GitAccess
def
ch
ange_access_check
(
change
)
def
ch
eck_single_change_access
(
change
)
if
user_access
.
can_do_action?
(
:create_wiki
)
build_status_object
(
true
)
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