fix(editor): Remove isOwner from IUser interface (#8888)

This commit is contained in:
Csaba Tuncsik
2024-03-18 11:39:15 +01:00
committed by GitHub
parent 024be62693
commit 6955e8991c
24 changed files with 74 additions and 65 deletions

View File

@@ -8,7 +8,6 @@ import { i18n as locale } from '@/plugins/i18n';
import { useUIStore } from '@/stores/ui.store';
import { N8N_PRICING_PAGE_URL } from '@/constants';
import { useToast } from '@/composables/useToast';
import { ROLE } from '@/utils/userUtils';
import { hasPermission } from '@/rbac/permissions';
const usageStore = useUsageStore();
@@ -29,9 +28,7 @@ const activationKey = ref('');
const activationKeyInput = ref<HTMLInputElement | null>(null);
const canUserActivateLicense = computed(() =>
hasPermission(['role'], {
role: [ROLE.Owner],
}),
hasPermission(['rbac'], { rbac: { scope: 'license:manage' } }),
);
const showActivationSuccess = () => {

View File

@@ -87,7 +87,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { mapStores } from 'pinia';
import { EnterpriseEditionFeature, INVITE_USER_MODAL_KEY, VIEWS } from '@/constants';
import { EnterpriseEditionFeature, INVITE_USER_MODAL_KEY, VIEWS, ROLE } from '@/constants';
import type { IUser, IUserListAction, InvitableRoleName } from '@/Interface';
import { useToast } from '@/composables/useToast';
@@ -97,7 +97,6 @@ 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/userUtils';
import { useClipboard } from '@/composables/useClipboard';
import type { UpdateGlobalRolePayload } from '@/api/users';
@@ -324,3 +323,4 @@ export default defineComponent({
left: calc(50% + 100px);
}
</style>
IRole,

View File

@@ -5,6 +5,7 @@ import { useSettingsStore } from '@/stores/settings.store';
import { useUsersStore } from '@/stores/users.store';
import { createComponentRenderer } from '@/__tests__/render';
import { setupServer } from '@/__tests__/server';
import { ROLE } from '@/constants';
let pinia: ReturnType<typeof createPinia>;
let settingsStore: ReturnType<typeof useSettingsStore>;
@@ -19,7 +20,7 @@ const currentUser = {
lastName: 'Doe',
email: 'joh.doe@example.com',
createdAt: Date().toString(),
isOwner: true,
role: ROLE.Owner,
isDefaultUser: false,
isPendingUser: false,
isPending: false,