fix(editor): Replace isInstanceOwner checks with scopes where applicable (#7858)
Co-authored-by: Alex Grozav <alex@grozav.com>
This commit is contained in:
@@ -60,7 +60,7 @@ import { getCurlToJson } from '@/api/curlHelper';
|
||||
import { useCloudPlanStore } from '@/stores/cloudPlan.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { hasPermission } from '@/rbac/permissions';
|
||||
import { useTelemetryStore } from '@/stores/telemetry.store';
|
||||
import { dismissBannerPermanently } from '@/api/ui';
|
||||
import type { BannerName } from 'n8n-workflow';
|
||||
@@ -374,9 +374,7 @@ export const useUIStore = defineStore(STORES.UI, {
|
||||
|
||||
const searchParams = new URLSearchParams();
|
||||
|
||||
const isOwner = useUsersStore().isInstanceOwner;
|
||||
|
||||
if (deploymentType === 'cloud' && isOwner) {
|
||||
if (deploymentType === 'cloud' && hasPermission(['instanceOwner'])) {
|
||||
const adminPanelHost = new URL(window.location.href).host.split('.').slice(1).join('.');
|
||||
const { code } = await useCloudPlanStore().getAutoLoginCode();
|
||||
linkUrl = `https://${adminPanelHost}/login`;
|
||||
|
||||
Reference in New Issue
Block a user