checking recursively to see if the selected category inherits from the current route, this is done to filter out all the inheritance chain to block the ability to mark a category as child of one of its own children no matter the depth of the relationship