mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
fix(editor): Replace isInstanceOwner checks with scopes where applicable (#7858)
Co-authored-by: Alex Grozav <alex@grozav.com>
This commit is contained in:
@@ -381,6 +381,8 @@ import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
import { useWorkflowsEEStore } from '@/stores/workflows.ee.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { createEventBus } from 'n8n-design-system/utils';
|
||||
import type { IPermissions } from '@/permissions';
|
||||
import { getWorkflowPermissions } from '@/permissions';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'WorkflowSettings',
|
||||
@@ -479,6 +481,9 @@ export default defineComponent({
|
||||
|
||||
return this.workflowsEEStore.getWorkflowOwnerName(`${this.workflowId}`, fallback);
|
||||
},
|
||||
workflowPermissions(): IPermissions {
|
||||
return getWorkflowPermissions(this.currentUser, this.workflow);
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
this.executionTimeout = this.rootStore.executionTimeout;
|
||||
@@ -584,8 +589,6 @@ export default defineComponent({
|
||||
};
|
||||
},
|
||||
async loadWorkflowCallerPolicyOptions() {
|
||||
const currentUserIsOwner = this.workflow.ownedBy?.id === this.currentUser?.id;
|
||||
|
||||
this.workflowCallerPolicyOptions = [
|
||||
{
|
||||
key: 'none',
|
||||
@@ -597,7 +600,7 @@ export default defineComponent({
|
||||
'workflowSettings.callerPolicy.options.workflowsFromSameOwner',
|
||||
{
|
||||
interpolate: {
|
||||
owner: currentUserIsOwner
|
||||
owner: this.workflowPermissions.isOwner
|
||||
? this.$locale.baseText(
|
||||
'workflowSettings.callerPolicy.options.workflowsFromSameOwner.owner',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user