ticket_states_controller.rb 955 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. class TicketStatesController < ApplicationController
  3. prepend_before_action :authentication_check
  4. # GET /ticket_states
  5. def index
  6. permission_check(['admin.object', 'ticket.agent', 'ticket.customer'])
  7. model_index_render(Ticket::State, params)
  8. end
  9. # GET /ticket_states/1
  10. def show
  11. permission_check(['admin.object', 'ticket.agent', 'ticket.customer'])
  12. model_show_render(Ticket::State, params)
  13. end
  14. # POST /ticket_states
  15. def create
  16. permission_check('admin.object')
  17. model_create_render(Ticket::State, params)
  18. end
  19. # PUT /ticket_states/1
  20. def update
  21. permission_check('admin.object')
  22. model_update_render(Ticket::State, params)
  23. end
  24. # DELETE /ticket_states/1
  25. def destroy
  26. permission_check('admin.object')
  27. return if model_references_check(Ticket::State, params)
  28. model_destroy_render(Ticket::State, params)
  29. end
  30. end