gitlab-org--gitlab-foss/lib/api
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
..
helpers API: Introduce #find_group! which also check access permission 2016-11-24 16:58:32 +01:00
access_requests.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
api.rb Merge branch 'api-order-mounts' into 'master' 2016-10-13 16:03:22 +00:00
api_guard.rb
award_emoji.rb GrapeDSL for Award Emoji endpoints 2016-10-03 10:32:09 +02:00
boards.rb Add support to group labels on issues board API 2016-10-19 14:58:26 -02:00
branches.rb Add button to delete all merged branches 2016-11-09 21:04:03 +01:00
broadcast_messages.rb Define common helper for describe pagination params in api 2016-11-22 09:19:26 +05:00
builds.rb Grapify builds API 2016-10-24 13:06:17 +02:00
commit_statuses.rb Don't convert data which already is the target type 2016-11-24 13:35:26 +01:00
commits.rb Don't convert data which already is the target type 2016-11-24 13:35:26 +01:00
deploy_keys.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
deployments.rb Define common helper for describe pagination params in api 2016-11-22 09:19:26 +05:00
entities.rb Merge branch 'zj-expose-coverage-pipelines' into 'master' 2016-11-25 16:51:53 +00:00
environments.rb Define common helper for describe pagination params in api 2016-11-22 09:19:26 +05:00
files.rb Add optional 'author' param when making commits 2016-09-19 10:00:26 -07:00
groups.rb Merge branch '22373-reduce-queries-in-api-helpers-find_project' into 'master' 2016-11-25 12:17:23 +00:00
helpers.rb Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security' 2016-11-28 21:26:23 -03:00
internal.rb Fix POST /internal/allowed to cope with gitlab-shell v4.0.0 project paths 2016-11-16 14:30:56 +00:00
issues.rb Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security' 2016-11-28 21:26:23 -03:00
keys.rb GrapeDSL for Keys endpoint 2016-10-01 11:11:41 +02:00
labels.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
lint.rb
members.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
merge_request_diffs.rb
merge_requests.rb Merge branch 'zj-fix-label-creation-non-members' into 'security' 2016-11-28 21:24:19 -03:00
milestones.rb Add a starting date to milestones 2016-11-23 13:41:04 +02:00
namespaces.rb GrapeDSL for Namespace endpoint 2016-10-04 07:47:29 +02:00
notes.rb Grapify the notes API 2016-11-15 16:28:11 +01:00
notification_settings.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
pagination_params.rb Define common helper for describe pagination params in api 2016-11-22 09:19:26 +05:00
pipelines.rb Merge branch '23532-define-common-helper-for-describe-pagination-params-in-api' into 'master' 2016-11-22 15:33:57 +00:00
project_hooks.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
project_snippets.rb Grapify the projects snippet API 2016-11-21 17:25:34 +01:00
projects.rb API: Introduce #find_project! which also check access permission 2016-11-24 14:40:35 +01:00
repositories.rb Grapify the repository API 2016-11-18 10:43:31 +01:00
runners.rb Use #to_h to convert params to a hash 2016-11-14 11:17:51 +01:00
services.rb API: Use #find_project in API::Triggers and API::Services 2016-11-24 13:22:38 +01:00
session.rb Grapify the session API 2016-11-09 17:36:35 +01:00
settings.rb Allow multiple repository storage shards to be enabled, and automatically round-robin between them 2016-11-04 04:01:08 +00:00
sidekiq_metrics.rb Grapify the sidekiq metrics API 2016-11-23 13:36:52 +01:00
subscriptions.rb Pass project to Entities::Label to check if user is subscribed 2016-11-17 15:10:13 -02:00
system_hooks.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
tags.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
templates.rb Create a new /templates API namespace 2016-10-12 11:09:41 +02:00
todos.rb Grapify todos API 2016-10-14 09:22:50 +02:00
triggers.rb API: Use #find_project in API::Triggers and API::Services 2016-11-24 13:22:38 +01:00
users.rb Fix StrongAttibutes error with Ruby 2.1 2016-11-21 18:47:55 +01:00
variables.rb Don't convert data which already is the target type 2016-11-24 13:35:26 +01:00
version.rb API: Version information 2016-10-12 16:47:35 +02:00