modify authorization middleware to support filtering for Whale