Revision 6e0f3e65 snf-pithos-backend/pithos/backends/lib/sqlite/permissions.py

b/snf-pithos-backend/pithos/backends/lib/sqlite/permissions.py
173 173
             "using (feature_id)")
174 174
        p = (member, member)
175 175
        if prefix:
176
            q += " where path like ? escape '\\'"
177
            p += (self.escape_like(prefix) + '%',)
176
            q += " where"
177
            for path in self.access_inherit(prefix) or [prefix]:
178
                q += " path like ? escape '\\'"
179
                p += (self.escape_like(path) + '%',)
178 180
        self.execute(q, p)
179 181

  
180 182
        l = [r[0] for r in self.fetchall()]
......
194 196
    def access_list_shared(self, prefix=''):
195 197
        """Return the list of shared paths."""
196 198

  
197
        q = "select path from xfeatures where path like ? escape '\\'"
198
        self.execute(q, (self.escape_like(prefix) + '%',))
199
        q = "select path from xfeatures where"
200
        p = []
201
        for path in self.access_inherit(prefix) or [prefix]:
202
            q += " path like ? escape '\\'"
203
            p += (self.escape_like(path) + '%',)
204
        self.execute(q, p)
199 205
        return [r[0] for r in self.fetchall()]

Also available in: Unified diff