From f329d34ff339f0d0da150b262465a654bfe445a5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 29 May 2014 22:03:42 +0300 Subject: Fix group projects fetch Signed-off-by: Dmitriy Zaporozhets --- app/controllers/groups_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index c8e13879b1d..a2629c51384 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -5,7 +5,7 @@ class GroupsController < ApplicationController # Authorize before_filter :authorize_read_group!, except: [:new, :create] - before_filter :authorize_admin_group!, only: [:edit, :update, :destroy] + before_filter :authorize_admin_group!, only: [:edit, :update, :destroy, :projects] before_filter :authorize_create_group!, only: [:new, :create] # Load group projects @@ -108,12 +108,12 @@ class GroupsController < ApplicationController end def project_ids - projects.pluck(:id) + @projects.pluck(:id) end # Dont allow unauthorized access to group def authorize_read_group! - unless @group and (projects.present? or can?(current_user, :read_group, @group)) + unless @group and (@projects.present? or can?(current_user, :read_group, @group)) if current_user.nil? return authenticate_user! else -- cgit v1.2.1