Skip to content

Commit

Permalink
Disable storage dashboard button for anon users
Browse files Browse the repository at this point in the history
Should largely avoid
https://sentry.galaxyproject.org/share/issue/79354f243bd44cbf833255e27d6dd8fa/:
```
Error: API authentication required for this request
  at rethrowSimple(webpack://@galaxyproject/galaxy-client/./src/utils/simple-error.ts:24:11)
  at <anonymous>(webpack://@galaxyproject/galaxy-client/./src/api/schema/fetcher.ts:19:9)
  at Generator.throw(<anonymous>)
  at rejected(webpack://@galaxyproject/galaxy-client/./src/api/schema/fetcher.ts:5:64)
```
Note that the stack trace isn't as informative as the url (
https://usegalaxy.org/storage/history/<history_id>) and referrer.
  • Loading branch information
mvdbeek committed Oct 2, 2024
1 parent 662aed0 commit 0411872
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const showPreferredObjectStoreModal = ref(false);
const historyPreferredObjectStoreId = ref(props.history.preferred_object_store_id);
const niceHistorySize = computed(() => prettyBytes(historySize.value));
const canManageStorage = computed(
() => userOwnsHistory(currentUser.value, props.history) && !currentUser.value?.isAnonymous
);
const storageLocationTitle = computed(() => {
if (isOnlyPreference.value) {
Expand Down Expand Up @@ -137,7 +140,7 @@ onMounted(() => {
variant="link"
size="sm"
class="rounded-0 text-decoration-none history-storage-overview-button"
:disabled="!userOwnsHistory(currentUser, props.history)"
:disabled="!canManageStorage"
data-description="storage dashboard button"
@click="onDashboard">
<FontAwesomeIcon :icon="faDatabase" />
Expand Down

0 comments on commit 0411872

Please sign in to comment.