0
0
Fork 0
salix-front-mindshore-fork2/src/composables/useRole.ts

18 lines
337 B
TypeScript
Raw Normal View History

2022-03-11 10:41:23 +00:00
import store from '@/store';
export function useRole() {
function hasAny(roles: string[]): boolean {
const roleStore: string[] = store.state.roles;
for (const role of roles) {
if (roleStore.indexOf(role) !== -1) return true;
}
return false;
}
return {
hasAny,
};
}