1
0
forked from test/crm

fix: cannot change role of user with Admin access

(cherry picked from commit 41b913debe153798def9d355e81a6a3e3fddf7fd)
This commit is contained in:
Shariq Ansari 2025-06-26 17:07:26 +05:30 committed by Mergify
parent 275e887dc2
commit 1a036a8b1c

View File

@ -119,7 +119,14 @@
}"
placement="right"
/>
<Tooltip
v-if="isManager() && user.role == 'System Manager'"
:text="__('Cannot change role of user with Admin access')"
>
<Button :label="__('Admin')" icon-left="shield" />
</Tooltip>
<Dropdown
v-else
:options="getDropdownOptions(user)"
:button="{
label: roleMap[user.role],
@ -163,7 +170,7 @@ import AddExistingUserModal from '@/components/Modals/AddExistingUserModal.vue'
import { activeSettingsPage } from '@/composables/settings'
import { usersStore } from '@/stores/users'
import { TemplateOption, DropdownOption } from '@/utils'
import { Avatar, TextInput, toast, call, FeatherIcon } from 'frappe-ui'
import { Avatar, TextInput, toast, call, FeatherIcon, Tooltip } from 'frappe-ui'
import { ref, computed, onMounted } from 'vue'
const { users, isAdmin, isManager } = usersStore()