Revision 56ac7c81

b/snf-pithos-backend/pithos/backends/modular.py
324 324
            start, limit = self._list_limits(allowed, marker, limit)
325 325
            return allowed[start:start + limit]
326 326
        if shared or public:
327
            allowed = []
327
            allowed = set()
328 328
            if shared:
329
                allowed.extend([x.split('/', 2)[1] for x in self.permissions.access_list_shared(account)])
329
                allowed.update([x.split('/', 2)[1] for x in self.permissions.access_list_shared(account)])
330 330
            if public:
331
                allowed.extend([x[0].split('/', 2)[1] for x in self.permissions.public_list(account)])
332
            allowed = list(set(allowed))
333
            allowed.sort()
331
                allowed.update([x[0].split('/', 2)[1] for x in self.permissions.public_list(account)])
332
            allowed = sorted(allowed)
334 333
            start, limit = self._list_limits(allowed, marker, limit)
335 334
            return allowed[start:start + limit]
336 335
        node = self.node.node_lookup(account)
......
529 528
            if not allowed:
530 529
                raise NotAllowedError
531 530
        else:
532
            allowed = []
531
            allowed = set()
533 532
            if shared:
534
                allowed.extend(self.permissions.access_list_shared(path))
533
                allowed.update(self.permissions.access_list_shared(path))
535 534
            if public:
536
                allowed.extend([x[0] for x in self.permissions.public_list(path)])
537
            allowed = list(set(allowed))
538
            allowed.sort()
535
                allowed.update([x[0] for x in self.permissions.public_list(path)])
536
            allowed = sorted(allowed)
539 537
            if not allowed:
540 538
                return []
541 539
        return allowed

Also available in: Unified diff