2012-02-15 10:20:44 +00:00
|
|
|
class OrbitBackendController< ApplicationController
|
|
|
|
before_filter :authenticate_user!
|
|
|
|
before_filter :setup_vars
|
|
|
|
# before_filter {|c| c.front_end_available(@app_title)}
|
|
|
|
before_filter :check_user_can_use,:except => [:public]
|
|
|
|
include OrbitCoreLib::PermissionUnility
|
2012-03-16 03:09:44 +00:00
|
|
|
include AdminHelper
|
2012-02-15 10:20:44 +00:00
|
|
|
|
|
|
|
layout 'admin'
|
|
|
|
|
|
|
|
def setup_vars
|
|
|
|
@app_title = request.fullpath.split('/')[2]
|
|
|
|
@module_app = ModuleApp.first(conditions: {:key => @app_title} )
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def check_user_can_use
|
|
|
|
unless check_permission
|
|
|
|
redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|