dedup logic for getting the permission mappings