'For the given list of datasets, return a mapping of the datasets\' ids
to whether they can be accessed by the user or not. The datasets input
is expected to be a simple list of Dataset objects.'

def dataset_access_mapping(self, trans, user_roles, datasets):

    datasets_public_map = self.datasets_are_public(trans, datasets)
    datasets_allow_action_map = self.allow_action_on_libitems(trans, user_roles, self.permitted_actions.DATASET_ACCESS, datasets)
    can_access = {}
    for dataset in datasets:
        can_access[dataset.id] = (datasets_public_map[dataset.id] or datasets_allow_action_map[dataset.id])
    return can_access
