Skip to content
Snippets Groups Projects
Commit 8ae3e010 authored by Tobias Grantner's avatar Tobias Grantner
Browse files

Fixed check for database read access

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