File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 <NcIconSvgWrapper class =" account-icon" :path =" mdiAccount" :size =" 20" />
1212 </template >
1313 </NcAppNavigationItem >
14- <NcAppNavigationItem :name =" t('libresign', 'Preferences')"
14+ <NcAppNavigationItem v-if =" canManagePreferences"
15+ :name =" t('libresign', 'Preferences')"
1516 :to =" {name: 'Preferences'}" >
1617 <template #icon >
1718 <NcIconSvgWrapper class =" preferences-icon" :path =" mdiTuneVariant" :size =" 20" />
@@ -67,6 +68,19 @@ const isAdmin = getCurrentUser()?.isAdmin ?? false
6768const config = loadState <{ can_manage_group_policies? : boolean }>(' libresign' , ' config' , {})
6869const policiesStore = usePoliciesStore ()
6970
71+ const canManagePreferences = computed (() => {
72+ const signatureFlowPolicy = policiesStore .policies .signature_flow
73+ if (! signatureFlowPolicy || typeof signatureFlowPolicy !== ' object' ) {
74+ return false
75+ }
76+
77+ const policyState = signatureFlowPolicy as {
78+ canSaveAsUserDefault? : boolean
79+ }
80+
81+ return policyState .canSaveAsUserDefault === true
82+ })
83+
7084const hasDelegatedEditablePolicies = computed (() => Object .values (policiesStore .policies ).some ((policy ) => {
7185 if (! policy || typeof policy !== ' object' ) {
7286 return false
@@ -90,6 +104,7 @@ function getAdminRoute() {
90104
91105defineExpose ({
92106 getAdminRoute ,
107+ canManagePreferences ,
93108 canManagePolicies ,
94109})
95110 </script >
You can’t perform that action at this time.
0 commit comments