summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard/groups_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/dashboard/groups_controller.rb')
-rw-r--r--app/controllers/dashboard/groups_controller.rb20
1 files changed, 4 insertions, 16 deletions
diff --git a/app/controllers/dashboard/groups_controller.rb b/app/controllers/dashboard/groups_controller.rb
index 742157d113d..0df086e1fb2 100644
--- a/app/controllers/dashboard/groups_controller.rb
+++ b/app/controllers/dashboard/groups_controller.rb
@@ -1,22 +1,10 @@
class Dashboard::GroupsController < Dashboard::ApplicationController
+ include GroupsTree
def index
- @groups =
- if params[:parent_id] && Group.supports_nested_groups?
- parent = Group.find_by(id: params[:parent_id])
+ parent = nil
+ parent = Group.find_by(id: params[:parent_id]) if params[:parent_id]
- if can?(current_user, :read_group, parent)
- GroupsFinder.new(current_user, parent: parent).execute
- else
- Group.none
- end
- else
- current_user.groups
- end
-
- @groups = @groups.search(params[:filter_groups]) if params[:filter_groups].present?
- @groups = @groups.includes(:route)
- @groups = @groups.sort(@sort = params[:sort])
- @groups = @groups.page(params[:page])
+ @groups = find_groups(parent, all_available: false)
respond_to do |format|
format.html