mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(editor): Only show push to git menu item to owners (#7766)
Removes the menu entry of "Push to Git" from the workflow menu for non-owners, since they would not be able to push in the first place.
This commit is contained in:
committed by
GitHub
parent
ff0b6511f7
commit
0d3d33dd1f
@@ -241,6 +241,9 @@ export default defineComponent({
|
||||
currentUser(): IUser | null {
|
||||
return this.usersStore.currentUser;
|
||||
},
|
||||
currentUserIsOwner(): boolean {
|
||||
return this.usersStore.currentUser?.isOwner ?? false;
|
||||
},
|
||||
contextBasedTranslationKeys(): NestedRecord<string> {
|
||||
return this.uiStore.contextBasedTranslationKeys;
|
||||
},
|
||||
@@ -321,15 +324,18 @@ export default defineComponent({
|
||||
);
|
||||
}
|
||||
|
||||
actions.push({
|
||||
id: WORKFLOW_MENU_ACTIONS.PUSH,
|
||||
label: this.$locale.baseText('menuActions.push'),
|
||||
disabled:
|
||||
!this.sourceControlStore.isEnterpriseSourceControlEnabled ||
|
||||
!this.onWorkflowPage ||
|
||||
this.onExecutionsTab ||
|
||||
this.readOnlyEnv,
|
||||
});
|
||||
if (this.currentUserIsOwner) {
|
||||
actions.push({
|
||||
id: WORKFLOW_MENU_ACTIONS.PUSH,
|
||||
label: this.$locale.baseText('menuActions.push'),
|
||||
disabled:
|
||||
!this.sourceControlStore.isEnterpriseSourceControlEnabled ||
|
||||
!this.onWorkflowPage ||
|
||||
this.onExecutionsTab ||
|
||||
this.readOnlyEnv ||
|
||||
!this.currentUserIsOwner,
|
||||
});
|
||||
}
|
||||
|
||||
actions.push({
|
||||
id: WORKFLOW_MENU_ACTIONS.SETTINGS,
|
||||
|
||||
Reference in New Issue
Block a user