forked from verdnatura/salix-front
18 lines
337 B
TypeScript
18 lines
337 B
TypeScript
|
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,
|
||
|
};
|
||
|
}
|