Plans to replace bedsits in a former YMCA building with a new food store and bakery have been approved by Bradford Council.