const checkPermission = (array2: string[], token: any): boolean => {
  if (token && token.role) {
    const array1: string[] = token?.role;

    return array1 ? array1.some((element) => array2.includes(element)) : false;
  } else return false;
};

export default checkPermission;
