code: fix multiple permissions lookup routine