Skip to content
Snippets Groups Projects
Commit 56417b96 authored by Steve Xuereb's avatar Steve Xuereb :speech_balloon:
Browse files

Merge branch 'security-private-group-11-3' into 'security-11-3'

[11.3] Fixed read name of private groups

See merge request gitlab/gitlabhq!2592
parents d88c4710 94a4ea05
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2,6 +2,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
include ActionView::Helpers::NumberHelper
 
before_action :authorize_read_project!, only: :index
before_action :authorize_read_group!, only: :index
before_action :find_todos, only: [:index, :destroy_all]
 
def index
Loading
Loading
@@ -58,6 +59,15 @@ class Dashboard::TodosController < Dashboard::ApplicationController
end
end
 
def authorize_read_group!
group_id = params[:group_id]
if group_id.present?
group = Group.find(group_id)
render_404 unless can?(current_user, :read_group, group)
end
end
def find_todos
@todos ||= TodosFinder.new(current_user, todo_params).execute
end
Loading
Loading
---
title: Removed ability to see private group names when the group id is entered in
the url.
merge_request:
author:
type: security
Loading
Loading
@@ -42,6 +42,16 @@ describe Dashboard::TodosController do
end
end
 
context 'group authorization' do
it 'renders 404 when user does not have read access on given group' do
unauthorized_group = create(:group, :private)
get :index, group_id: unauthorized_group.id
expect(response).to have_gitlab_http_status(404)
end
end
context 'when using pagination' do
let(:last_page) { user.todos.page.total_pages }
let!(:issues) { create_list(:issue, 3, project: project, assignees: [user]) }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment