Class: DashboardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/dashboard_controller.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) accounts



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/dashboard_controller.rb', line 6

def accounts
  authorize! :read, current_user
  @location_metric = Metric.find Setting.location_metric.id

  if current_user.is_admin?
    @admins = User.admins
    @users = User.non_admins
    @locations = Metric.descendants_of @location_metric
  else
    @users = User.accessible_by current_ability
    @locations = Metric.subtree_of current_user.team
  end
end

- (Object) resources



19
20
21
# File 'app/controllers/dashboard_controller.rb', line 19

def resources
  authorize! :read, current_user
end

- (Object) show



3
4
5
# File 'app/controllers/dashboard_controller.rb', line 3

def show
  authorize! :read, current_user
end