mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 22:51:05 +03:30
new C'hnages
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
export {
|
||||
$hasRole
|
||||
}
|
||||
Reference in New Issue
Block a user