useTicketCreate.ts 608 B

1234567891011121314151617181920
  1. // Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. import { computed } from 'vue'
  3. import { useApplicationStore } from '@shared/stores/application'
  4. import { useSessionStore } from '@shared/stores/session'
  5. export const useTicketCreate = () => {
  6. const application = useApplicationStore()
  7. const session = useSessionStore()
  8. const ticketCreateEnabled = computed(() => {
  9. return (
  10. session.hasPermission('ticket.agent') ||
  11. (session.hasPermission('ticket.customer') &&
  12. application.config.customer_ticket_create)
  13. )
  14. })
  15. return { ticketCreateEnabled }
  16. }