diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-29 22:03:42 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-29 22:03:42 +0300 |
commit | f329d34ff339f0d0da150b262465a654bfe445a5 (patch) | |
tree | 44c964420bc3505554f8875c7ae665cc943f0f2b /app | |
parent | 8f259c5ecca69af417e10cba11c329a95d3052d9 (diff) | |
download | gitlab-ce-f329d34ff339f0d0da150b262465a654bfe445a5.tar.gz |
Fix group projects fetch
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/groups_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |