useCheckChangePassword.ts 529 B

12345678910111213141516171819
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { computed } from 'vue'
  3. import { useApplicationStore } from '#shared/stores/application.ts'
  4. import { useSessionStore } from '#shared/stores/session.ts'
  5. export const useCheckChangePassword = () => {
  6. const { config } = useApplicationStore()
  7. const { hasPermission } = useSessionStore()
  8. const canChangePassword = computed(
  9. () => config.user_show_password_login || hasPermission('admin.*'),
  10. )
  11. return {
  12. canChangePassword,
  13. }
  14. }