Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: permissions for collections and folders

Liyas Thomasab0bc3e9279a
diff --git a/components/collections/Collection.vue b/components/collections/Collection.vue
index bda4c93c8..1d0086306 100644
--- a/components/collections/Collection.vue
+++ b/components/collections/Collection.vue
@@ -91,12 +91,9 @@
class="icon"
@click="$emit('edit-collection')"
v-close-popover
- disabled
>
<i class="material-icons">create</i>
- <div v-tooltip.left="$t('disable_new_collection')">
- <span>{{ $t("edit") }}</span>
- </div>
+ <span>{{ $t("edit") }}</span>
</button>
<button v-else class="icon" @click="$emit('edit-collection')" v-close-popover>
<i class="material-icons">create</i>
@@ -112,12 +109,9 @@
class="icon"
@click="confirmRemove = true"
v-close-popover
- disabled
>
<i class="material-icons">add</i>
- <div v-tooltip.left="$t('disable_new_collection')">
- <span>{{ $t("delete") }}</span>
- </div>
+ <span>{{ $t("delete") }}</span>
</button>
<button v-else class="icon" @click="confirmRemove = true" v-close-popover>
<i class="material-icons">delete</i>
diff --git a/components/collections/Folder.vue b/components/collections/Folder.vue
index 51759da78..8a25608d8 100644
--- a/components/collections/Folder.vue
+++ b/components/collections/Folder.vue
@@ -42,7 +42,14 @@
</button>
</div>
<v-popover v-if="!saveRequest">
- <button class="tooltip-target icon" v-tooltip.left="$t('more')">
+ <button
+ v-if="
+ collectionsType.type == 'team-collections' &&
+ collectionsType.selectedTeam.myRole !== 'VIEWER'
+ "
+ class="tooltip-target icon"
+ v-tooltip.left="$t('more')"
+ >
<i class="material-icons">more_vert</i>
</button>
<template slot="popover">
@@ -75,7 +82,15 @@
</button>
</div>
<div>
- <button class="icon" @click="confirmRemove = true" v-close-popover>
+ <button
+ v-if="
+ collectionsType.type == 'team-collections' &&
+ collectionsType.selectedTeam.myRole !== 'VIEWER'
+ "
+ class="icon"
+ @click="confirmRemove = true"
+ v-close-popover
+ >
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>