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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
c5e4b443
Commit
c5e4b443
authored
May 13, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GitAccess.
parent
1981174a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
13 deletions
+6
-13
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+3
-2
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+3
-11
No files found.
lib/gitlab/git_access.rb
View file @
c5e4b443
...
...
@@ -136,7 +136,7 @@ module Gitlab
end
unless
user
.
can?
(
action
,
project
)
return
status
=
case
action
when
:force_push_code_to_protected_branches
build_status_object
(
false
,
"You are not allowed to force push code to a protected branch on this project."
)
...
...
@@ -149,6 +149,7 @@ module Gitlab
else
# :push_code
build_status_object
(
false
,
"You are not allowed to push code to this project."
)
end
return
status
end
build_status_object
(
true
)
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
c5e4b443
...
...
@@ -115,19 +115,11 @@ describe Gitlab::GitAccess do
let
(
:actor
)
{
key
}
context
'pull code'
do
context
'allowed'
do
before
{
key
.
projects
<<
project
}
subject
{
access
.
download_access_check
}
it
{
expect
(
subject
.
allowed?
).
to
be_truthy
}
end
context
'denied'
do
subject
{
access
.
download_access_check
}
it
{
expect
(
subject
.
allowed?
).
to
be_falsey
}
end
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