mirror of
https://github.com/filegator/filegator.git
synced 2025-01-29 10:37:58 +01:00
Fix: for LDAP auth when user credentials are invalid (#407)
* Fix: for LDAP auth when user credentials are invalid * Fix: for LDAP auth when user credentials are invalid
This commit is contained in:
parent
7f33cc8805
commit
7e0f460d9e
@ -92,7 +92,7 @@ const funcs = {
|
||||
})
|
||||
},
|
||||
is(role) {
|
||||
return this.$store.state.user.role == role
|
||||
return this.$store.state?.user?.role == role
|
||||
},
|
||||
can(permissions) {
|
||||
return this.$store.getters.hasPermissions(permissions)
|
||||
|
@ -24,9 +24,9 @@ export default new Vuex.Store({
|
||||
getters: {
|
||||
hasPermissions: (state) => (permissions) => {
|
||||
if (_.isArray(permissions)) {
|
||||
return _.intersection(state.user.permissions, permissions).length == permissions.length
|
||||
return _.intersection(state.user?.permissions, permissions).length == permissions.length
|
||||
}
|
||||
return _.find(state.user.permissions, p => p == permissions) ? true : false
|
||||
return _.find(state.user?.permissions, p => p == permissions) ? true : false
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user