Class: ComplianceEngineController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ComplianceEngineController
- Includes:
- CompliancePluginHelper
- Defined in:
- app/controllers/compliance_engine_controller.rb
Constant Summary collapse
- APP_CONFIG =
Load configuration items (MANDATORY, must be included)
HashWithIndifferentAccess.new(YAML.load(File.read(File.('../../../config/compliance/compliance_config.yml', __FILE__))))
Instance Method Summary collapse
- #configure ⇒ Object
-
#index ⇒ Object
Write your readme here.
- #installer ⇒ Object
Methods included from CompliancePluginHelper
#current_user, #get_current_user_role
Instance Method Details
#configure ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/controllers/compliance_engine_controller.rb', line 21 def configure # Check access if (@curUserRole == 'contentadmin' || @curUserRole == 'user' || @curUserRole == 'loggedin' || @curUserRole == 'anonymous') raise 'unauthorized access' end config = Metadata.first({ :conditions => ['sites_id = ? and cat = ? and key = ?', session[:accessible_appid], APP_CONFIG[:COMPLIANCE_CAT_CONFIG], APP_CONFIG[:COMPLIANCE_ACTIVATION_CONFIG]]}) if (!defined?(PaperTrail)) raise 'paper_trail gem is required for this gem to work' end if (config.nil?) raise 'configuration item for compliance plugin is not present' end if request.xhr? respond_to do |t| t.html end else raise 'unauthorized access' end end |
#index ⇒ Object
Write your readme here
17 18 19 |
# File 'app/controllers/compliance_engine_controller.rb', line 17 def index end |
#installer ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'app/controllers/compliance_engine_controller.rb', line 49 def installer # Check access if (@curUserRole == 'contentadmin' || @curUserRole == 'user' || @curUserRole == 'loggedin' || @curUserRole == 'anonymous') raise 'unauthorized access' end if request.xhr? respond_to do |t| t.html end else raise 'unauthorized access' end end |