Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow up 33992f1 - Feature: Desktop view - Implement personal settin…
…g section to change the password.
- Loading branch information
Showing
6 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/frontend/apps/desktop/pages/personal-setting/composables/useCheckChangePassword.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
import { computed } from 'vue' | ||
|
||
import { useApplicationStore } from '#shared/stores/application.ts' | ||
import { useSessionStore } from '#shared/stores/session.ts' | ||
|
||
export const useCheckChangePassword = () => { | ||
const { config } = useApplicationStore() | ||
const { hasPermission } = useSessionStore() | ||
|
||
const canChangePassword = computed(() => { | ||
const canChangePassword = | ||
config.user_show_password_login || hasPermission('admin.*') | ||
|
||
if (!canChangePassword) return false | ||
|
||
return hasPermission('user_preferences.password') | ||
}) | ||
|
||
return { | ||
canChangePassword, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters