import tools from '@/utils/tools';

export function permission(data) {
	let permissions = tools.data.get("PERMISSIONS");
	if (!permissions) {
		return false;
	}
	return permissions.includes(data);
}

export function noPermission(data) {
	return !permission(data);
}

export function rolePermission(data) {
	let roles = tools.data.get("ROLE");
	if (!roles) {
		return false;
	}
	return roles.includes(data);
}

export function noRolePermission(data) {
	return !rolePermission(data);
}
