feat(editor): Add routing middleware, permission checks, RBAC store, RBAC component (#7702)

Github issue / Community forum post (link here to close automatically):

---------

Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
This commit is contained in:
Alex Grozav
2023-11-23 13:22:47 +02:00
committed by GitHub
parent fdb2c18ecc
commit 67a88914f2
62 changed files with 1935 additions and 646 deletions

View File

@@ -2,7 +2,7 @@
<div :class="$style.container">
<div>
<n8n-heading size="2xlarge">{{ $locale.baseText('settings.users') }}</n8n-heading>
<div :class="$style.buttonContainer" v-if="!usersStore.showUMSetupWarning">
<div :class="$style.buttonContainer" v-if="!showUMSetupWarning">
<n8n-tooltip :disabled="!ssoStore.isSamlLoginEnabled">
<template #content>
<span> {{ $locale.baseText('settings.users.invite.tooltip') }} </span>
@@ -70,6 +70,8 @@ import { useSettingsStore } from '@/stores/settings.store';
import { useUsersStore } from '@/stores/users.store';
import { useUsageStore } from '@/stores/usage.store';
import { useSSOStore } from '@/stores/sso.store';
import { hasPermission } from '@/rbac/permissions';
import { ROLE } from '@/utils';
export default defineComponent({
name: 'SettingsUsersView',
@@ -80,7 +82,7 @@ export default defineComponent({
};
},
async mounted() {
if (!this.usersStore.showUMSetupWarning) {
if (!this.showUMSetupWarning) {
await this.usersStore.fetchUsers();
}
},
@@ -89,6 +91,9 @@ export default defineComponent({
isSharingEnabled() {
return this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.Sharing);
},
showUMSetupWarning() {
return hasPermission(['role'], { role: [ROLE.Default] });
},
usersListActions(): IUserListAction[] {
return [
{