Skip to content
Snippets Groups Projects
Commit 073f3a2a authored by Martin Weise's avatar Martin Weise
Browse files

Merge branch '295-bug-data-tab-on-table-info-page-not-shown-on-public-databases' into 'dev'

Fixed check for database read access

See merge request !147
parents 585bbe01 8ae3e010
Branches
Tags
2 merge requests!163Relase 1.3.0,!147Fixed check for database read access
......@@ -101,6 +101,9 @@ export default {
return this.access.type === 'write_own' || this.access.type === 'write_all'
},
canRead () {
if (this.database?.is_public) {
return true
}
if (!this.access) {
return false
}
......
......@@ -116,6 +116,9 @@ export default {
return formatTimestampUTCLabel(this.tableDetails.created)
},
canRead () {
if (this.database?.is_public) {
return true
}
if (!this.user || !this.access) {
return false
}
......
......@@ -105,6 +105,9 @@ export default {
return this.access.type === 'write_own' || this.access.type === 'write_all'
},
canRead () {
if (this.database?.is_public) {
return true
}
if (!this.access) {
return false
}
......
......@@ -327,6 +327,7 @@ export default {
this.$store.commit('SET_ACCESS', res.data)
console.debug('access', this.access)
} catch (err) {
this.$store.commit('SET_ACCESS', null)
const { status } = err.response
if (status !== 401 && status !== 403) {
console.error('Failed to check access', err)
......
......@@ -157,6 +157,9 @@ export default {
return this.access.type === 'write_all'
},
canRead () {
if (this.database?.is_public) {
return true
}
if (!this.user || !this.access) {
return false
}
......
......@@ -147,6 +147,9 @@ export default {
return this.$store.state.table
},
canRead () {
if (this.database?.is_public) {
return true
}
if (!this.user || !this.access) {
return false
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment