diff options
author | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-17 17:16:46 +0300 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-08-02 11:42:45 +0300 |
commit | e60ec75303475083746e2d09d2a99cc5c6ea0221 (patch) | |
tree | fd68e107263c1dc856620db07de30ba3583d6025 /app | |
parent | 15179878d57addb010b5afeadd4bde8b62ef3acb (diff) |
Don’t do authorisation checks for todos
Diffstat (limited to 'app')
-rw-r--r-- | app/finders/todos_finder.rb | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/app/finders/todos_finder.rb b/app/finders/todos_finder.rb index 2156413fb26..c505a5cc8d5 100644 --- a/app/finders/todos_finder.rb +++ b/app/finders/todos_finder.rb @@ -39,7 +39,6 @@ class TodosFinder # Filtering by project HAS TO be the last because we use # the project IDs yielded by the todos query thus far items = by_project(items) - items = visible_to_user(items) sort(items) end @@ -96,10 +95,6 @@ class TodosFinder @project = Project.find(params[:project_id]) @project = nil if @project.pending_delete? - - unless Ability.allowed?(current_user, :read_project, @project) - @project = nil - end else @project = nil end @@ -170,20 +165,6 @@ class TodosFinder items end - def visible_to_user(items) - projects = Project.public_or_visible_to_user(current_user) - groups = Group.public_or_visible_to_user(current_user) - - items - .joins('LEFT JOIN namespaces ON namespaces.id = todos.group_id') - .joins('LEFT JOIN projects ON projects.id = todos.project_id') - .where( - 'project_id IN (?) OR group_id IN (?)', - projects.select(:id), - groups.select(:id) - ) - end - def by_state(items) case params[:state].to_s when 'done' |