diff --git a/packages/nc-gui/components/general/ShareBaseButton.vue b/packages/nc-gui/components/general/ShareBaseButton.vue index 833f0ce511..17c0c7356f 100644 --- a/packages/nc-gui/components/general/ShareBaseButton.vue +++ b/packages/nc-gui/components/general/ShareBaseButton.vue @@ -3,22 +3,35 @@ import { useRoute, useUIPermission } from '#imports' const route = useRoute() -const showUserModal = $ref(false) +const showUserModal = ref(false) const { isUIAllowed } = useUIPermission() + +const isShareBaseAllowed = + isUIAllowed('newUser') && + route.name !== 'index' && + route.name !== 'index-index-create' && + route.name !== 'index-index-create-external' && + route.name !== 'index-user-index' + +useEventListener(document, 'keydown', async (e: KeyboardEvent) => { + if (e.altKey) { + switch (e.keyCode) { + case 73: { + // ALT + I + if (isShareBaseAllowed) { + showUserModal.value = true + } + break + } + } + } +})