Fix incorrect permission fetching