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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
477743a1
Commit
477743a1
authored
Oct 24, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_internal_snippets' into '7-4-stable'
Fix internal snippets See merge request !1216
parents
9712fbcd
7f97a127
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
1 deletion
+15
-1
CHANGELOG
CHANGELOG
+5
-0
VERSION
VERSION
+1
-1
app/finders/snippets_finder.rb
app/finders/snippets_finder.rb
+2
-0
spec/finders/snippets_finder_spec.rb
spec/finders/snippets_finder_spec.rb
+7
-0
No files found.
CHANGELOG
View file @
477743a1
v 7.4.2
- Fix internal snippet exposing for unauthenticated users
v 7.4.1
- Fix LDAP authentication for Git HTTP access
- Fix LDAP config lookup for provider 'ldap'
- Fix public snippets
- Fix 500 error on projects with nested submodules
v 7.4.0
- Refactored membership logic
...
...
VERSION
View file @
477743a1
7.4.
1
7.4.
2
app/finders/snippets_finder.rb
View file @
477743a1
...
...
@@ -29,6 +29,8 @@ class SnippetsFinder
def
by_user
(
current_user
,
user
,
scope
)
snippets
=
user
.
snippets
.
fresh
.
non_expired
return
snippets
.
are_public
unless
current_user
if
user
==
current_user
case
scope
when
'are_internal'
then
...
...
spec/finders/snippets_finder_spec.rb
View file @
477743a1
...
...
@@ -64,6 +64,13 @@ describe SnippetsFinder do
snippets
=
SnippetsFinder
.
new
.
execute
(
user
,
filter: :by_user
,
user:
user
)
snippets
.
should
include
(
@snippet1
,
@snippet2
,
@snippet3
)
end
it
"returns only public snippets if unauthenticated user"
do
snippets
=
SnippetsFinder
.
new
.
execute
(
nil
,
filter: :by_user
,
user:
user
)
snippets
.
should
include
(
@snippet3
)
snippets
.
should_not
include
(
@snippet2
,
@snippet1
)
end
end
context
'by_project filter'
do
...
...
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