diff --git a/dbrepo-table-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java b/dbrepo-table-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java index a028e5da8f9bfb304357848c6efb43f6cfd07a9e..bc5c696fd912b6535ccf5adc778c29af0a738dd5 100644 --- a/dbrepo-table-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java +++ b/dbrepo-table-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java @@ -180,8 +180,8 @@ public class TableEndpoint { throws TableNotFoundException, DatabaseNotFoundException, ContainerNotFoundException, NotAllowedException { log.debug("endpoint find table, containerId={}, databaseId={}, tableId={}, principal={}", containerId, databaseId, tableId, principal); - endpointValidator.validateOnlyPrivateAccess(containerId, databaseId, principal); - endpointValidator.validateOnlyPrivateHasRole(containerId, databaseId, principal, "find-table"); +// endpointValidator.validateOnlyPrivateAccess(containerId, databaseId, principal); +// endpointValidator.validateOnlyPrivateHasRole(containerId, databaseId, principal, "find-table"); final Table table = tableService.findById(containerId, databaseId, tableId); final TableDto dto = tableMapper.tableToTableDto(table); log.trace("find table resulted in table {}", dto); diff --git a/dbrepo-ui/components/DBToolbar.vue b/dbrepo-ui/components/DBToolbar.vue index ecbc4fe11eb68ae156c440c4ba0dc64ec4343886..b8590bc855355dd9d2e0207a20becb97c25f4e6d 100644 --- a/dbrepo-ui/components/DBToolbar.vue +++ b/dbrepo-ui/components/DBToolbar.vue @@ -55,7 +55,7 @@ <v-tab :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/table`"> {{ $t('databases.toolbar.tables', { name: 'vue-i18n' }) }} </v-tab> - <v-tab :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/query`"> + <v-tab v-if="hasReadAccess" :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/query`"> {{ $t('databases.toolbar.subsets', { name: 'vue-i18n' }) }} </v-tab> <v-tab :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/view`"> diff --git a/dbrepo-ui/components/TableToolbar.vue b/dbrepo-ui/components/TableToolbar.vue index c11713dd33b36508a043d6112125d6f5a00838e0..b3f22595c99e203c8b9309e3b9cb29aa998d3f0b 100644 --- a/dbrepo-ui/components/TableToolbar.vue +++ b/dbrepo-ui/components/TableToolbar.vue @@ -2,7 +2,7 @@ <div v-if="table"> <v-toolbar flat> <v-toolbar-title> - <v-btn id="back-btn" class="mr-2" :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/table`"> + <v-btn id="back-btn" plain class="mr-2" :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/table`"> <v-icon left>mdi-arrow-left</v-icon> </v-btn> </v-toolbar-title> diff --git a/dbrepo-ui/layouts/default.vue b/dbrepo-ui/layouts/default.vue index 82ed12293a3f0a75108dff7f901ac7747ce69e65..8f9358cb23445b85c536ecd2a37662f3f8e0bbae 100644 --- a/dbrepo-ui/layouts/default.vue +++ b/dbrepo-ui/layouts/default.vue @@ -125,7 +125,6 @@ import AuthenticationService from '@/api/authentication.service' import DatabaseService from '@/api/database.service' import TableService from '@/api/table.service' -import IdentifierService from '@/api/identifier.service' export default { data () { @@ -262,7 +261,7 @@ export default { this.loading = false this.loadTable() }) - .catch(() => { + .finally(() => { this.loading = false }) }, @@ -296,20 +295,6 @@ export default { this.loading = false }) }, - loadIdentifier () { - if (!this.database || 'identifier' in this.database) { - return - } - this.loading = true - IdentifierService.find(this.database.identifier.id) - .then((identifier) => { - this.database.identifier = identifier - this.$store.commit('SET_DATABASE', this.database) - }) - .finally(() => { - this.loading = false - }) - }, retrieve () { this.$router.push({ path: '/search', query: { q: this.search } }) } diff --git a/dbrepo-ui/store/index.js b/dbrepo-ui/store/index.js index 70ffc1c3170b79f0369baa019bdd5e4edb120d3b..e42e49e0d00ab0266b0b35aabab5c273a190146c 100644 --- a/dbrepo-ui/store/index.js +++ b/dbrepo-ui/store/index.js @@ -61,6 +61,12 @@ const store = new Store({ commit('SET_USER', user) }) }, + reloadAccess ({ state, commit }) { + DatabaseService.checkAccess(state.container.id, state.database.id) + .then((access) => { + commit('SET_ACCESS', access) + }) + }, reloadDatabase ({ state, commit }) { DatabaseService.findOne(state.database.container.id, state.database.id) .then((database) => {