Revision 9c6ddb46

b/snf-pithos-backend/pithos/backends/modular.py
723 723
                      size_range, all_props, public):
724 724
        if user != account and until:
725 725
            raise NotAllowedError
726

  
727
        objects = []
726 728
        if shared and public:
727 729
            # get shared first
728 730
            shared_paths = self._list_object_permissions(
729 731
                user, account, container, prefix, shared=True, public=False)
730
            objects = set()
731 732
            if shared_paths:
732 733
                path, node = self._lookup_container(account, container)
733 734
                shared_paths = self._get_formatted_paths(shared_paths)
734
                objects |= set(self._list_object_properties(
735
                objects = set(self._list_object_properties(
735 736
                    node, path, prefix, delimiter, marker, limit, virtual,
736 737
                    domain, keys, until, size_range, shared_paths, all_props))
737 738

  
......
741 742
            objects = list(objects)
742 743

  
743 744
            objects.sort(key=lambda x: x[0])
744
            start, limit = self._list_limits(
745
                [x[0] for x in objects], marker, limit)
746
            return objects[start:start + limit]
747 745
        elif public:
748 746
            objects = self._list_public_object_properties(
749 747
                user, account, container, prefix, all_props)
750
            start, limit = self._list_limits(
751
                [x[0] for x in objects], marker, limit)
752
            return objects[start:start + limit]
748
        else:
749
            allowed = self._list_object_permissions(
750
                user, account, container, prefix, shared, public=False)
751
            if shared and not allowed:
752
                return []
753
            path, node = self._lookup_container(account, container)
754
            allowed = self._get_formatted_paths(allowed)
755
            objects = self._list_object_properties(
756
                node, path, prefix, delimiter, marker, limit, virtual, domain,
757
                keys, until, size_range, allowed, all_props)
753 758

  
754
        allowed = self._list_object_permissions(
755
            user, account, container, prefix, shared, public)
756
        if shared and not allowed:
757
            return []
758
        path, node = self._lookup_container(account, container)
759
        allowed = self._get_formatted_paths(allowed)
760
        objects = self._list_object_properties(
761
            node, path, prefix, delimiter, marker, limit, virtual, domain,
762
            keys, until, size_range, allowed, all_props)
763
        start, limit = self._list_limits(
764
            [x[0] for x in objects], marker, limit)
759
        # apply limits
760
        start, limit = self._list_limits(objects, marker, limit)
765 761
        return objects[start:start + limit]
766 762

  
767 763
    def _list_public_object_properties(self, user, account, container, prefix,

Also available in: Unified diff