Creates before action for product and categories controller