Class: Api::V2::Compliance::OvalContentsController
- Inherits:
-
BaseController
- Object
- BaseController
- Api::V2::Compliance::OvalContentsController
- Includes:
- Foreman::Controller::Parameters::OvalContent, ForemanOpenscap::Api::V2::ScapApiControllerExtensions
- Defined in:
- app/controllers/api/v2/compliance/oval_contents_controller.rb
Instance Method Summary collapse
- #action_permission ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #show ⇒ Object
- #sync ⇒ Object
- #update ⇒ Object
Instance Method Details
#action_permission ⇒ Object
62 63 64 65 66 67 68 69 |
# File 'app/controllers/api/v2/compliance/oval_contents_controller.rb', line 62 def case params[:action] when 'sync' :update else super end end |
#create ⇒ Object
37 38 39 40 |
# File 'app/controllers/api/v2/compliance/oval_contents_controller.rb', line 37 def create @oval_content = ForemanOpenscap::OvalContent.new(oval_content_params) process_response @oval_content.save end |
#destroy ⇒ Object
53 54 55 |
# File 'app/controllers/api/v2/compliance/oval_contents_controller.rb', line 53 def destroy process_response @oval_content.destroy end |
#index ⇒ Object
14 15 16 |
# File 'app/controllers/api/v2/compliance/oval_contents_controller.rb', line 14 def index @oval_contents = resource_scope_for_index(:permission => :view_oval_contents) end |
#show ⇒ Object
21 22 |
# File 'app/controllers/api/v2/compliance/oval_contents_controller.rb', line 21 def show end |
#sync ⇒ Object
58 59 60 |
# File 'app/controllers/api/v2/compliance/oval_contents_controller.rb', line 58 def sync @oval_contents = ForemanOpenscap::Oval::SyncOvalContents.new.sync_all end |
#update ⇒ Object
46 47 48 |
# File 'app/controllers/api/v2/compliance/oval_contents_controller.rb', line 46 def update process_response @oval_content.update(oval_content_params) end |