organizations_controller_policy.rb 510 B

12345678910111213
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Controllers::OrganizationsControllerPolicy < Controllers::ApplicationControllerPolicy
  3. permit! :import_example, to: 'admin.organization'
  4. permit! :import_start, to: 'admin.user'
  5. permit! %i[create update destroy search history], to: ['ticket.agent', 'admin.organization']
  6. def show?
  7. return true if user.permissions?(['ticket.agent', 'admin.organization'])
  8. user.organization_id?(record.params[:id].to_i)
  9. end
  10. end