diff options
| author | Felipe Artur <felipefac@gmail.com> | 2016-03-02 19:13:50 -0300 |
|---|---|---|
| committer | Felipe Artur <felipefac@gmail.com> | 2016-03-10 10:38:36 -0300 |
| commit | 5551ccd7201ea6b45a2e2721502ba55e8f525d8f (patch) | |
| tree | 65d9b9c37f1ed839d4e16953207e82a9629dd9dc /app/controllers | |
| parent | f2a9ee258e0ee3a6fe0cb614e4b73c56dcd7339d (diff) | |
| download | gitlab-ce-5551ccd7201ea6b45a2e2721502ba55e8f525d8f.tar.gz | |
Code improvements
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/groups_controller.rb | 4 | ||||
| -rw-r--r-- | app/controllers/users_controller.rb | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 13de19bc141..6532eee1602 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -9,7 +9,7 @@ class GroupsController < Groups::ApplicationController before_action :group, except: [:index, :new, :create] # Authorize - before_action :authorize_read_group!, except: [:index, :show, :new, :create, :autocomplete] + before_action :authorize_read_group!, except: [:index, :new, :create] before_action :authorize_admin_group!, only: [:edit, :update, :destroy, :projects] before_action :authorize_create_group!, only: [:new, :create] @@ -105,7 +105,7 @@ class GroupsController < Groups::ApplicationController # Dont allow unauthorized access to group def authorize_read_group! - unless @group and (@projects.present? or can?(current_user, :read_group, @group)) + unless can?(current_user, :read_group, @group) if current_user.nil? return authenticate_user! else diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e10c633690f..d26a1ce6737 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,6 +3,16 @@ class UsersController < ApplicationController before_action :set_user def show +<<<<<<< HEAD +======= + @contributed_projects = contributed_projects.joined(@user).reject(&:forked?) + + @projects = PersonalProjectsFinder.new(@user).execute(current_user) + @projects = @projects.page(params[:page]).per(PER_PAGE) + + @groups = @user.groups.order_id_desc + +>>>>>>> Code improvements respond_to do |format| format.html |
