mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 03:21:07 +03:30
18 lines
412 B
JavaScript
Vendored
18 lines
412 B
JavaScript
Vendored
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
|
|
}
|