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
0987ec88
Commit
0987ec88
authored
Jul 26, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken user_allowed check in Git Annex push
Closes #816
parent
8a3cc2f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
CHANGELOG-EE
CHANGELOG-EE
+3
-2
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+2
-2
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+2
-0
No files found.
CHANGELOG-EE
View file @
0987ec88
...
...
@@ -3,8 +3,9 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.11.0 (unreleased)
v 8.10.2 (unreleased)
- Dicouple an ES index update from RepositoryUpdateMirrorWorker
- Fix pagination on search result page when ES search is enabled
- Decouple an ES index update from RepositoryUpdateMirrorWorker
- Fix broken user_allowed check in Git Annex push
- Fix pagination on search result page when ES search is enabled
v 8.10.1
- No EE-specific changes
...
...
lib/gitlab/git_access.rb
View file @
0987ec88
...
...
@@ -253,7 +253,7 @@ module Gitlab
end
def
git_annex_access_check
(
project
,
changes
)
unless
user
&&
user_allowed?
unless
user
&&
user_a
ccess
.
a
llowed?
return
build_status_object
(
false
,
"You don't have access"
)
end
...
...
@@ -265,7 +265,7 @@ module Gitlab
return
build_status_object
(
false
,
"You can't use git-annex with a secondary GitLab Geo node."
)
end
if
user
.
can?
(
:push_code
,
project
)
if
user
.
can?
(
:push_code
,
project
)
&&
git_annex_branch_sync?
(
changes
)
build_status_object
(
true
)
else
build_status_object
(
false
,
"You don't have permission"
)
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
0987ec88
...
...
@@ -363,12 +363,14 @@ describe Gitlab::GitAccess, lib: true do
describe
'git annex enabled'
do
before
{
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:git_annex_enabled
).
and_return
(
true
)
}
it
{
expect
(
access
.
check
(
'git-annex-shell'
,
[]).
allowed?
).
to
be_truthy
}
it
{
expect
(
access
.
push_access_check
(
git_annex_changes
)).
to
be_allowed
}
end
describe
'git annex disabled'
do
before
{
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:git_annex_enabled
).
and_return
(
false
)
}
it
{
expect
(
access
.
check
(
'git-annex-shell'
,
[]).
allowed?
).
to
be_falsey
}
it
{
expect
(
access
.
push_access_check
(
git_annex_changes
)).
not_to
be_allowed
}
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