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

Disable buttons for S3 manipulation for unauthorized users

#15
parent 091d6f09
No related branches found
No related tags found
1 merge request!12Add direct S3 interaction
This commit is part of merge request !12. Comments created here will be created in the context of that merge request.
......@@ -222,6 +222,10 @@ const errorLoadingObjects: ComputedRef<boolean> = computed(
() => objectState.bucketPermissionError || objectState.bucketNotFoundError
);
const writeS3Permission: ComputedRef<boolean> = computed(
() => props.permission == undefined || props.permission.permission == "READWRITE"
);
// Lifecycle Hooks
// -----------------------------------------------------------------------------
onMounted(() => {
......@@ -466,7 +470,7 @@ watch(
<button
type="button"
class="btn btn-secondary me-2 tooltip-container"
:disabled="errorLoadingObjects"
:disabled="errorLoadingObjects || !writeS3Permission"
data-bs-toggle="modal"
data-bs-title="Upload Object"
data-bs-target="#upload-object-modal"
......@@ -486,7 +490,7 @@ watch(
<button
type="button"
class="btn btn-secondary m-2 tooltip-container"
:disabled="errorLoadingObjects"
:disabled="errorLoadingObjects || !writeS3Permission"
data-bs-toggle="modal"
data-bs-title="Create Folder"
data-bs-target="#create-folder-modal"
......@@ -666,16 +670,17 @@ watch(
<button class="dropdown-item" type="button">Details</button>
</li>
<li>
<button class="dropdown-item" type="button">Edit</button>
<button class="dropdown-item" type="button" :disabled="!writeS3Permission">Edit</button>
</li>
<li>
<button class="dropdown-item" type="button">Copy</button>
<button class="dropdown-item" type="button" :disabled="!writeS3Permission">Copy</button>
</li>
<li>
<button
class="dropdown-item text-danger align-middle"
type="button"
@click="deleteObject(obj.key)"
:disabled="!writeS3Permission"
>
<bootstrap-icon
icon="trash-fill"
......@@ -694,6 +699,7 @@ watch(
<button
type="button"
class="btn btn-danger btn-sm align-middle"
:disabled="!writeS3Permission"
@click="
deleteFolder(
obj.parentFolder.join('/') + '/' + obj.name + '/'
......
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