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

20 lines
359 B
JavaScript
Raw Normal View History

import { useState } from './useState';
2022-03-11 10:41:23 +00:00
export function useRole() {
2022-03-28 07:06:36 +00:00
function hasAny(roles) {
const { getRoles } = useState();
2022-03-28 07:06:36 +00:00
const roleStore = getRoles();
2022-03-11 10:41:23 +00:00
for (const role of roles) {
if (roleStore.value.indexOf(role) !== -1) return true;
2022-03-11 10:41:23 +00:00
}
return false;
}
return {
hasAny,
};
}