Merge "Add missing check in hasGrantedPolicy"