Orbit/app/controllers/orbit_backend_controller.rb

30 lines
733 B
Ruby
Raw Normal View History

class OrbitBackendController< ApplicationController
before_filter :force_order,:except => [:public]
before_filter :setup_vars
# before_filter {|c| c.front_end_available(@app_title)}
# before_filter :check_user_can_use
include OrbitCoreLib::PermissionUnility
2012-03-16 03:09:44 +00:00
include AdminHelper
layout 'new_admin'
def setup_vars
@app_title = request.fullpath.split('/')[2]
@module_app = ModuleApp.first(conditions: {:key => @app_title} )
end
private
def force_order
authenticate_user!
check_user_can_use
end
def check_user_can_use
unless check_permission
2012-04-26 08:45:46 +00:00
#redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
render :text => '403 Forbidden'
end
end
end