'For a given list of library items (e.g., Datasets), return a map of the
datasets\' ids to whether they can have permission to use that action
(e.g., "access" or "modify") on the dataset. The libitems input is
expected to be a simple list of library items, such as Datasets or
LibraryDatasets.
NB: This is currently only usable for Datasets; it was intended to
be used for any library item.'

def dataset_permission_map_for_access(self, trans, user_roles, libitems):

    libitems_public_map = self.datasets_are_public(trans, libitems)
    libitems_allow_action_map = self.allow_action_on_libitems(trans, user_roles, self.permitted_actions.DATASET_ACCESS, libitems)
    can_access = {}
    for libitem in libitems:
        can_access[libitem.id] = (libitems_public_map[libitem.id] or libitems_allow_action_map[libitem.id])
    return can_access
