mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 03:42:16 +00:00
feat: RBAC (#8922)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Val <68596159+valya@users.noreply.github.com> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in> Co-authored-by: Valya Bullions <valya@n8n.io> Co-authored-by: Danny Martini <danny@n8n.io> Co-authored-by: Danny Martini <despair.blue@gmail.com> Co-authored-by: Iván Ovejero <ivov.src@gmail.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: oleg <me@olegivaniv.com> Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com> Co-authored-by: Elias Meire <elias@meire.dev> Co-authored-by: Giulio Andreini <andreini@netseven.it> Co-authored-by: Giulio Andreini <g.andreini@gmail.com> Co-authored-by: Ayato Hayashi <go12limchangyong@gmail.com>
This commit is contained in:
@@ -20,6 +20,10 @@
|
||||
<div :class="$style.logo">
|
||||
<img :src="logoPath" data-test-id="n8n-logo" :class="$style.icon" alt="n8n" />
|
||||
</div>
|
||||
<ProjectNavigation
|
||||
:collapsed="isCollapsed"
|
||||
:plan-name="cloudPlanStore.currentPlanData?.displayName"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template #beforeLowerMenu>
|
||||
@@ -126,6 +130,7 @@ import { hasPermission } from '@/rbac/permissions';
|
||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||
import { useDebounce } from '@/composables/useDebounce';
|
||||
import { useBecomeTemplateCreatorStore } from '@/components/BecomeTemplateCreatorCta/becomeTemplateCreatorStore';
|
||||
import ProjectNavigation from '@/features/projects/components/ProjectNavigation.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'MainSidebar',
|
||||
@@ -134,6 +139,7 @@ export default defineComponent({
|
||||
ExecutionsUsage,
|
||||
MainSidebarSourceControl,
|
||||
BecomeTemplateCreatorCta,
|
||||
ProjectNavigation,
|
||||
},
|
||||
mixins: [userHelpers],
|
||||
setup(props, ctx) {
|
||||
@@ -205,31 +211,21 @@ export default defineComponent({
|
||||
mainMenuItems(): IMenuItem[] {
|
||||
const items: IMenuItem[] = [];
|
||||
|
||||
const workflows: IMenuItem = {
|
||||
id: 'workflows',
|
||||
icon: 'network-wired',
|
||||
label: this.$locale.baseText('mainSidebar.workflows'),
|
||||
position: 'top',
|
||||
route: { to: { name: VIEWS.WORKFLOWS } },
|
||||
secondaryIcon: this.sourceControlStore.preferences.branchReadOnly
|
||||
? {
|
||||
name: 'lock',
|
||||
tooltip: {
|
||||
content: this.$locale.baseText('mainSidebar.workflows.readOnlyEnv.tooltip'),
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
|
||||
const defaultSettingsRoute = this.findFirstAccessibleSettingsRoute();
|
||||
const regularItems: IMenuItem[] = [
|
||||
workflows,
|
||||
{
|
||||
id: 'cloud-admin',
|
||||
position: 'bottom',
|
||||
label: 'Admin Panel',
|
||||
icon: 'cloud',
|
||||
available: this.settingsStore.isCloudDeployment && hasPermission(['instanceOwner']),
|
||||
},
|
||||
{
|
||||
// Link to in-app templates, available if custom templates are enabled
|
||||
id: 'templates',
|
||||
icon: 'box-open',
|
||||
label: this.$locale.baseText('mainSidebar.templates'),
|
||||
position: 'top',
|
||||
position: 'bottom',
|
||||
available:
|
||||
this.settingsStore.isTemplatesEnabled && this.templatesStore.hasCustomTemplatesHost,
|
||||
route: { to: { name: VIEWS.TEMPLATES } },
|
||||
@@ -239,7 +235,7 @@ export default defineComponent({
|
||||
id: 'templates',
|
||||
icon: 'box-open',
|
||||
label: this.$locale.baseText('mainSidebar.templates'),
|
||||
position: 'top',
|
||||
position: 'bottom',
|
||||
available:
|
||||
this.settingsStore.isTemplatesEnabled && !this.templatesStore.hasCustomTemplatesHost,
|
||||
link: {
|
||||
@@ -247,35 +243,20 @@ export default defineComponent({
|
||||
target: '_blank',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'credentials',
|
||||
icon: 'key',
|
||||
label: this.$locale.baseText('mainSidebar.credentials'),
|
||||
customIconSize: 'medium',
|
||||
position: 'top',
|
||||
route: { to: { name: VIEWS.CREDENTIALS } },
|
||||
},
|
||||
{
|
||||
id: 'variables',
|
||||
icon: 'variable',
|
||||
label: this.$locale.baseText('mainSidebar.variables'),
|
||||
customIconSize: 'medium',
|
||||
position: 'top',
|
||||
position: 'bottom',
|
||||
route: { to: { name: VIEWS.VARIABLES } },
|
||||
},
|
||||
{
|
||||
id: 'executions',
|
||||
icon: 'tasks',
|
||||
label: this.$locale.baseText('mainSidebar.executions'),
|
||||
position: 'top',
|
||||
route: { to: { name: VIEWS.EXECUTIONS } },
|
||||
},
|
||||
{
|
||||
id: 'cloud-admin',
|
||||
position: 'bottom',
|
||||
label: 'Admin Panel',
|
||||
icon: 'home',
|
||||
available: this.settingsStore.isCloudDeployment && hasPermission(['instanceOwner']),
|
||||
route: { to: { name: VIEWS.EXECUTIONS } },
|
||||
},
|
||||
{
|
||||
id: 'settings',
|
||||
|
||||
Reference in New Issue
Block a user