Commit graph

9 commits

Author SHA1 Message Date
Douwe Maan
3bf34face4 Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security'
Replace issue access checks with use of IssuableFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

## Which fixes are in this MR?

⚠️ - Potentially untested  
💣 - No test coverage  
🚥 - Test coverage of some sort exists (a test failed when error raised)  
🚦 - Test coverage of return value (a test failed when nil used)  
 - Permissions check tested

### Issue lookup with access check

Using `visible_to_user` likely makes these security issues too. See [Code smells](#code-smells).

- [x] 🚦 app/finders/notes_finder.rb:15 [`visible_to_user`]
- [x] 🚥 app/views/layouts/nav/_project.html.haml:73 [`visible_to_user`] [`.count`]
- [x]  app/services/merge_requests/build_service.rb:84 [`issue.try(:confidential?)`]
- [x]  lib/api/issues.rb:112 [`visible_to_user`]
  - CHANGELOG: Prevented API returning issues set to 'Only team members' to everyone
- [x]  lib/api/helpers.rb:126 [`can?(current_user, :read_issue, issue)`] Maybe here too?
- [x]  lib/gitlab/search_results.rb:53 [`visible_to_user`]

### Previous discussions
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b2ff264eddf9819d7693c14ae213d941494fe2b3_128_126
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#7b6375270d22f880bdcb085e47b519b426a5c6c7_87_87

See merge request !2031
2016-11-28 21:26:23 -03:00
Valery Sizov
a5632e802b Search for a filename in a project 2016-11-16 14:25:54 +02:00
tiagonbotelho
1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Douglas Barbosa Alexandre
b56c456750 Project members with guest role can't access confidential issues 2016-06-13 19:32:00 -03:00
Douglas Barbosa Alexandre
f2ba4e3d36 Restrict access to confidential issues on search results 2016-03-17 20:55:59 -03:00
Yorick Peterse
300332bbf6 Fixed ProjectSearchResults spec to use a Project
This spec was still passing an ID to the #initialize method instead of
a Project instance.
2016-03-11 15:25:23 -05:00
Douwe Maan
13d6bab177 Tag lib specs 2015-12-09 11:55:42 +01:00
Dirceu Pereira Tiegs
d7bcfe4fc0 Fix issue #3055 (project search with unmatched parentheses) 2015-10-21 10:20:40 -02:00
Stan Hu
62079d7654 Add init test for ProjectSearchResults
See: https://github.com/gitlabhq/gitlabhq/pull/9368#issuecomment-110350335
2015-06-18 10:35:48 -07:00