Class: Sibu::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Sibu::ApplicationController
show all
- Defined in:
- app/controllers/sibu/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#check_site_ownership! ⇒ Object
14
15
16
17
18
19
20
|
# File 'app/controllers/sibu/application_controller.rb', line 14
def check_site_ownership!
if conf[:multi_user] && conf[:admin_filter]
unless @site.nil? || @site.user_id == sibu_user.id || conf[:admin_filter].call(sibu_user)
redirect_to main_app.root_url, alert: "Vous n'êtes pas autorisé(e) à consulter cette page."
end
end
end
|
#conf ⇒ Object
6
7
8
|
# File 'app/controllers/sibu/application_controller.rb', line 6
def conf
Rails.application.config.sibu
end
|
#sibu_user ⇒ Object
10
11
12
|
# File 'app/controllers/sibu/application_controller.rb', line 10
def sibu_user
send(conf[:current_user])
end
|