Skip to content
Snippets Groups Projects
Verified Commit fc7beba7 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Disable download and copy options for WRITE-only buckets

#30
parent 9e94c4c0
No related branches found
No related tags found
2 merge requests!84Remove development branch,!26Resolve "Adjust UI for WRITE-only buckets"
Pipeline #24753 passed
......@@ -283,6 +283,9 @@ const errorLoadingObjects: ComputedRef<boolean> = computed(
const writableBucket: ComputedRef<boolean> = computed(() =>
bucketRepository.writableBucket(props.bucketName)
);
const readableBucket: ComputedRef<boolean> = computed(() =>
bucketRepository.readableBucket(props.bucketName)
);
// Lifecycle Hooks
// -----------------------------------------------------------------------------
......@@ -799,6 +802,7 @@ watch(
type="button"
class="btn btn-secondary"
@click="downloadObject(obj.key, props.bucketName)"
:disabled="!readableBucket"
>
Download
</button>
......@@ -839,7 +843,7 @@ watch(
<button
class="dropdown-item"
type="button"
:disabled="!writableBucket"
:disabled="!writableBucket || !readableBucket"
data-bs-toggle="modal"
data-bs-target="#copy-object-modal"
@click="objectState.copyObject = obj"
......
......@@ -31,6 +31,11 @@ export const useBucketStore = defineStore({
this.ownPermissions[bucketName] === undefined ||
this.ownPermissions[bucketName].permission !== "READ";
},
readableBucket(): (bucketName: string) => boolean {
return (bucketName) =>
this.ownPermissions[bucketName] === undefined ||
this.ownPermissions[bucketName].permission !== "WRITE";
},
},
actions: {
_fetchOwnPermissions(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment