Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Fix list action icons not showing on the UI based on permissions. Closes #2640.

Kailash Nadhad66878ea0ed
diff --git a/frontend/src/main.js b/frontend/src/main.js
index 46d11e67..0b914c5c 100644
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -68,6 +68,12 @@ async function initConfig(app) {
return true;
}
+ // If the user role has global list permissions, return true.
+ const can = Vue.prototype.$can('lists:get_all', 'lists:manage_all');
+ if (can) {
+ return true;
+ }
+
return profile.listRole.lists.some((list) => list.id === id && list.permissions.includes(perm));
};
diff --git a/frontend/src/views/Lists.vue b/frontend/src/views/Lists.vue
index d586a16f..92e8b1cc 100644
--- a/frontend/src/views/Lists.vue
+++ b/frontend/src/views/Lists.vue
@@ -126,7 +126,7 @@
</b-tooltip>
</a>
- <router-link v-if="$can('lists:import')" :to="{ name: 'import', query: { list_id: props.row.id } }"
+ <router-link v-if="$can('subscribers:import')" :to="{ name: 'import', query: { list_id: props.row.id } }"
data-cy="btn-import">
<b-tooltip :label="$t('import.title')" type="is-dark">
<b-icon icon="file-upload-outline" size="is-small" />