def _get_permissions_info(
        self, item: Dict[str, Any], userprincipalname: str, access_token: str
    ) -> Dict[str, Any]:
        """
        Extracts the permissions information for the file in OneDrive.

        Args:
            item (Dict[str, Any]): Dictionary containing file metadata.

        Returns:
            Dict[str, Any]: A dictionary containing the extracted permissions information.

        """
        item_id = item.get("id")

        if self._is_interactive_auth:
            permissions_info_endpoint = (
                f"https://graph.microsoft.com/v1.0/me/drive/items/{item_id}/permissions"
            )
        else:
            permissions_info_endpoint = f"https://graph.microsoft.com/v1.0/users/{userprincipalname}/drive/items/{item_id}/permissions"

        headers = {"Authorization": f"Bearer {access_token}"}

        response = requests.get(url=permissions_info_endpoint, headers=headers)
        permissions = response.json()
        identity_sets = []

        for permission in permissions["value"]:
            # user type permissions
            granted_to = permission.get("grantedToV2", None)
            if granted_to:
                identity_sets.append(granted_to)

            # link type permissions
            granted_to_identities = permission.get("grantedToIdentitiesV2", [])
            for identity in granted_to_identities:
                identity_sets.append(identity)

        # Extract the identity information from each identity set
        # they can be 'application', 'device', 'user', 'group', 'siteUser' or 'siteGroup'
        # 'siteUser' and 'siteGroup' are site-specific, 'group' is for Microsoft 365 groups
        permissions_dict = {}

        for identity_set in identity_sets:
            for identity, identity_info in identity_set.items():
                # For OneDrive, we don't need to consider siteUser and siteGroup
                if identity in ["siteUser", "siteGroup"]:
                    continue

                id = identity_info.get("id")
                display_name = identity_info.get("displayName")
                ids_key = f"allowed_{identity}_ids"
                display_names_key = f"allowed_{identity}_display_names"

                if ids_key not in permissions_dict:
                    permissions_dict[ids_key] = []
                if display_names_key not in permissions_dict:
                    permissions_dict[display_names_key] = []

                permissions_dict[ids_key].append(id)
                permissions_dict[display_names_key].append(display_name)

        return permissions_dict

        Extracts the permissions information for the file in OneDrive.

        Args:
            item (Dict[str, Any]): Dictionary containing file metadata.

        Returns:
            Dict[str, Any]: A dictionary containing the extracted permissions information.

        
llama-index-integrations/readers/llama-index-readers-microsoft-onedrive/llama_index/readers/microsoft_onedrive/base.py