2011-12-20 08:47:17 +00:00
|
|
|
class Admin::AppAuthsController < ApplicationController
|
|
|
|
layout "admin"
|
|
|
|
before_filter :authenticate_user!
|
2012-01-17 08:20:03 +00:00
|
|
|
# before_filter :is_admin? ,:only => :index
|
2011-12-20 08:47:17 +00:00
|
|
|
|
|
|
|
def index
|
2012-01-12 06:13:41 +00:00
|
|
|
# @roles = Role.all.entries
|
|
|
|
# apps = Purchase.where(:type =>"App")
|
|
|
|
# @app_auth_data = apps.entries.map do |app|
|
|
|
|
# app_c = eval(app.app_controller)
|
|
|
|
# obj = app_c.new
|
|
|
|
# obj_auth = obj.send "auth"
|
|
|
|
# [:app_obj => app,:auth_field => obj_auth]
|
|
|
|
# end
|
2012-01-17 08:20:03 +00:00
|
|
|
if current_user.admin?
|
|
|
|
@module_apps = ModuleApp.all
|
|
|
|
else
|
|
|
|
@module_apps = current_user.managing_apps.collect{|t| t.managing_app}
|
|
|
|
end
|
2011-12-20 08:47:17 +00:00
|
|
|
end
|
|
|
|
|
2012-01-13 10:20:04 +00:00
|
|
|
def edit
|
|
|
|
@module_app = ModuleApp.find(params[:id])
|
|
|
|
end
|
|
|
|
|
2012-01-17 08:20:03 +00:00
|
|
|
|
2012-01-13 10:20:04 +00:00
|
|
|
|
2011-12-20 08:47:17 +00:00
|
|
|
end
|