Class: Radesk::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/radesk/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#radesk_authorize!Object



8
9
10
# File 'app/controllers/radesk/application_controller.rb', line 8

def radesk_authorize!
  redirect_to Radesk. if !(radesk_current_user)
end

#radesk_authorize_admin!Object



12
13
14
# File 'app/controllers/radesk/application_controller.rb', line 12

def radesk_authorize_admin!
  redirect_to root_path if !(radesk_current_user.radesk_admin?)
end

#radesk_check_access(object) ⇒ Object



16
17
18
# File 'app/controllers/radesk/application_controller.rb', line 16

def radesk_check_access(object)
  redirect_to root_path unless object.has_access?(radesk_current_user)
end

#radesk_current_userObject



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

def radesk_current_user
  send(Radesk.current_user_method_name)
end