Approval has been given to demolish a functioning primary school in Sheffield and rebuild it with new facilities - including a pool.