feat: 优化鉴权

This commit is contained in:
ibuler
2020-06-04 15:36:53 +08:00
parent ff39a2a19a
commit 154d118949
5 changed files with 28 additions and 17 deletions

View File

@@ -42,8 +42,9 @@ export default {
},
computed: {
isInAdminRole() {
console.log(this.currentRole)
return (this.currentRole & rolec.PERM_ADMIN) === rolec.PERM_ADMIN
const inAdmin = rolec.hasPerm(this.currentRole, rolec.PERM_ADMIN)
this.$log.debug('Current in admin role: ', inAdmin)
return inAdmin
},
hasAdminRole() {
return this.currentOrgRoles.includes('Admin')
@@ -54,9 +55,6 @@ export default {
'currentOrgRoles'
])
},
mounted() {
console.log('Roles: ', this.currentOrgRoles)
},
methods: {
handleClick(val) {
switch (val) {