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
c5e4b443
Commit
c5e4b443
authored
May 13, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GitAccess.
parent
1981174a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
13 deletions
+6
-13
git_access.rb
lib/gitlab/git_access.rb
+3
-2
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."
)
...
...
@@ -148,7 +148,8 @@ module Gitlab
build_status_object
(
false
,
"You are not allowed to change existing tags on this project."
)
else
# :push_code
build_status_object
(
false
,
"You are not allowed to push code to this project."
)
end
end
return
status
end
build_status_object
(
true
)
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
c5e4b443
...
...
@@ -115,18 +115,10 @@ 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
}
before
{
key
.
projects
<<
project
}
subject
{
access
.
download_access_check
}
it
{
expect
(
subject
.
allowed?
).
to
be_falsey
}
end
it
{
expect
(
subject
.
allowed?
).
to
be_truthy
}
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