mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-12 19:03:24 +03:30
fix
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TokenService } from '@/services'
|
||||
|
||||
const $hasRole = function (roles) {
|
||||
if (TokenService.getToken()) {
|
||||
roles = roles.split('|');
|
||||
for (const role of roles) {
|
||||
if (TokenService.getInfo().roles && Array.isArray(TokenService.getInfo().roles) && TokenService.getInfo().roles.includes(role)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export {
|
||||
$hasRole
|
||||
}
|
||||
Reference in New Issue
Block a user