Merge ~pappacena/launchpad:snap-pillar-list-filters into launchpad:master
- Git
- lp:~pappacena/launchpad
- snap-pillar-list-filters
- Merge into master
Proposed by
Thiago F. Pappacena
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Thiago F. Pappacena | ||||
Approved revision: | 3742242858c44d9b9733e109be0c851afda3ba14 | ||||
Merge reported by: | Otto Co-Pilot | ||||
Merged at revision: | not available | ||||
Proposed branch: | ~pappacena/launchpad:snap-pillar-list-filters | ||||
Merge into: | launchpad:master | ||||
Prerequisite: | ~pappacena/launchpad:snap-pillar-subscribe-ui | ||||
Diff against target: |
323 lines (+225/-17) 2 files modified
lib/lp/snappy/browser/tests/test_snaplisting.py (+201/-1) lib/lp/snappy/model/snap.py (+24/-16) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+398751@code.launchpad.net |
Commit message
Filtering for visible snaps on +snaps pages
Description of the change
To post a comment you must log in.
- 94902ed... by Thiago F. Pappacena
-
Merge branch 'snap-pillar-
subscribe- ui' into snap-pillar- list-filters - 3742242... by Thiago F. Pappacena
-
Merge branch 'snap-pillar-
subscribe- ui' into snap-pillar- list-filters
Revision history for this message
Colin Watson (cjwatson) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/lib/lp/snappy/browser/tests/test_snaplisting.py b/lib/lp/snappy/browser/tests/test_snaplisting.py | |||
2 | index ce229c1..9216c91 100644 | |||
3 | --- a/lib/lp/snappy/browser/tests/test_snaplisting.py | |||
4 | +++ b/lib/lp/snappy/browser/tests/test_snaplisting.py | |||
5 | @@ -1,4 +1,4 @@ | |||
7 | 1 | # Copyright 2015-2017 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2015-2021 Canonical Ltd. This software is licensed under the |
8 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
9 | 3 | 3 | ||
10 | 4 | """Test snap package listings.""" | 4 | """Test snap package listings.""" |
11 | @@ -27,7 +27,9 @@ from lp.services.database.constants import ( | |||
12 | 27 | SEVEN_DAYS_AGO, | 27 | SEVEN_DAYS_AGO, |
13 | 28 | UTC_NOW, | 28 | UTC_NOW, |
14 | 29 | ) | 29 | ) |
15 | 30 | from lp.services.features.testing import FeatureFixture | ||
16 | 30 | from lp.services.webapp import canonical_url | 31 | from lp.services.webapp import canonical_url |
17 | 32 | from lp.snappy.interfaces.snap import SNAP_TESTING_FLAGS | ||
18 | 31 | from lp.testing import ( | 33 | from lp.testing import ( |
19 | 32 | ANONYMOUS, | 34 | ANONYMOUS, |
20 | 33 | BrowserTestCase, | 35 | BrowserTestCase, |
21 | @@ -154,6 +156,204 @@ class TestSnapListing(BrowserTestCase): | |||
22 | 154 | snap-name.* Team Name.* ~.*:.* .* | 156 | snap-name.* Team Name.* ~.*:.* .* |
23 | 155 | snap-name.* Team Name.* lp:.* .*""", text) | 157 | snap-name.* Team Name.* lp:.* .*""", text) |
24 | 156 | 158 | ||
25 | 159 | def test_project_private_snap_listing(self): | ||
26 | 160 | # Only users with permission can see private snap packages in the list | ||
27 | 161 | # for a project. | ||
28 | 162 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | ||
29 | 163 | project = self.factory.makeProduct(displayname="Snappable") | ||
30 | 164 | private_owner = self.factory.makePerson() | ||
31 | 165 | user_with_permission = self.factory.makePerson() | ||
32 | 166 | someone_else = self.factory.makePerson() | ||
33 | 167 | private_snap = self.factory.makeSnap( | ||
34 | 168 | name="private-snap", | ||
35 | 169 | private=True, registrant=private_owner, owner=private_owner, | ||
36 | 170 | branch=self.factory.makeProductBranch(product=project), | ||
37 | 171 | date_created=ONE_DAY_AGO) | ||
38 | 172 | with person_logged_in(private_owner): | ||
39 | 173 | private_snap.subscribe(user_with_permission, private_owner) | ||
40 | 174 | [ref] = self.factory.makeGitRefs(target=project) | ||
41 | 175 | self.factory.makeSnap(git_ref=ref, date_created=UTC_NOW) | ||
42 | 176 | |||
43 | 177 | full_list = """ | ||
44 | 178 | Snap packages for Snappable | ||
45 | 179 | Name Owner Source Registered | ||
46 | 180 | snap-name.* Team Name.* ~.*:.* .* | ||
47 | 181 | private-snap.* Person-name.* lp:.* .*""" | ||
48 | 182 | |||
49 | 183 | public_list = """ | ||
50 | 184 | Snap packages for Snappable | ||
51 | 185 | Name Owner Source Registered | ||
52 | 186 | snap-name.* Team Name.* ~.*:.* .*""" | ||
53 | 187 | |||
54 | 188 | # private_owner: full_list. | ||
55 | 189 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
56 | 190 | full_list, self.getMainText(project, "+snaps", user=private_owner)) | ||
57 | 191 | # user_with_permission: full_list. | ||
58 | 192 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
59 | 193 | full_list, | ||
60 | 194 | self.getMainText(project, "+snaps", user=user_with_permission)) | ||
61 | 195 | # someone_else: public_list. | ||
62 | 196 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
63 | 197 | public_list, | ||
64 | 198 | self.getMainText(project, "+snaps", user=someone_else)) | ||
65 | 199 | # Not logged in: public_list. | ||
66 | 200 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
67 | 201 | public_list, self.getMainText(project, "+snaps", user=None)) | ||
68 | 202 | |||
69 | 203 | def test_person_private_snap_listing(self): | ||
70 | 204 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | ||
71 | 205 | private_owner = self.factory.makePerson(name="random-user") | ||
72 | 206 | user_with_permission = self.factory.makePerson() | ||
73 | 207 | someone_else = self.factory.makePerson() | ||
74 | 208 | private_snap = self.factory.makeSnap( | ||
75 | 209 | name="private-snap", | ||
76 | 210 | private=True, registrant=private_owner, owner=private_owner, | ||
77 | 211 | date_created=ONE_DAY_AGO) | ||
78 | 212 | with person_logged_in(private_owner): | ||
79 | 213 | private_snap.subscribe(user_with_permission, private_owner) | ||
80 | 214 | [ref] = self.factory.makeGitRefs() | ||
81 | 215 | self.factory.makeSnap( | ||
82 | 216 | private=False, registrant=private_owner, owner=private_owner, | ||
83 | 217 | git_ref=ref, date_created=UTC_NOW) | ||
84 | 218 | |||
85 | 219 | full_list = """ | ||
86 | 220 | Snap packages for Random-user | ||
87 | 221 | Name Source Registered | ||
88 | 222 | snap-name.* ~.*:.* .* | ||
89 | 223 | private-snap.* lp:.* .*""" | ||
90 | 224 | |||
91 | 225 | public_list = """ | ||
92 | 226 | Snap packages for Random-user | ||
93 | 227 | Name Source Registered | ||
94 | 228 | snap-name.* ~.*:.* .*""" | ||
95 | 229 | |||
96 | 230 | # private_owner: full_list. | ||
97 | 231 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
98 | 232 | full_list, self.getMainText(private_owner, "+snaps", | ||
99 | 233 | user=private_owner)) | ||
100 | 234 | # user_with_permission: full_list. | ||
101 | 235 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
102 | 236 | full_list, self.getMainText(private_owner, "+snaps", | ||
103 | 237 | user=user_with_permission)) | ||
104 | 238 | # someone_else: public_list. | ||
105 | 239 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
106 | 240 | public_list, self.getMainText(private_owner, "+snaps", | ||
107 | 241 | user=someone_else)) | ||
108 | 242 | # Not logged in: public_list. | ||
109 | 243 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
110 | 244 | public_list, self.getMainText(private_owner, "+snaps", user=None)) | ||
111 | 245 | |||
112 | 246 | def test_branch_private_snap_listing(self): | ||
113 | 247 | # Only certain users can see private snaps on branch listing. | ||
114 | 248 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | ||
115 | 249 | private_owner = self.factory.makePerson(name="random-user") | ||
116 | 250 | user_with_permission = self.factory.makePerson() | ||
117 | 251 | someone_else = self.factory.makePerson() | ||
118 | 252 | branch = self.factory.makeAnyBranch() | ||
119 | 253 | private_snap = self.factory.makeSnap( | ||
120 | 254 | private=True, name="private-snap", | ||
121 | 255 | owner=private_owner, registrant=private_owner, branch=branch) | ||
122 | 256 | with person_logged_in(private_owner): | ||
123 | 257 | private_snap.subscribe(user_with_permission, private_owner) | ||
124 | 258 | self.factory.makeSnap( | ||
125 | 259 | private=False, owner=private_owner, registrant=private_owner, | ||
126 | 260 | branch=branch) | ||
127 | 261 | full_list = """ | ||
128 | 262 | Snap packages for lp:.* | ||
129 | 263 | Name Owner Registered | ||
130 | 264 | snap-name.* Random-user.* .* | ||
131 | 265 | private-snap.* Random-user.* .*""" | ||
132 | 266 | public_list = """ | ||
133 | 267 | Snap packages for lp:.* | ||
134 | 268 | Name Owner Registered | ||
135 | 269 | snap-name.* Random-user.* .*""" | ||
136 | 270 | |||
137 | 271 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
138 | 272 | full_list, self.getMainText(branch, "+snaps", user=private_owner)) | ||
139 | 273 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
140 | 274 | full_list, self.getMainText(branch, "+snaps", | ||
141 | 275 | user=user_with_permission)) | ||
142 | 276 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
143 | 277 | public_list, self.getMainText(branch, "+snaps", user=someone_else)) | ||
144 | 278 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
145 | 279 | public_list, self.getMainText(branch, "+snaps", user=None)) | ||
146 | 280 | |||
147 | 281 | def test_git_repository_private_snap_listing(self): | ||
148 | 282 | # Only certain users can see private snaps on git repo listing. | ||
149 | 283 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | ||
150 | 284 | private_owner = self.factory.makePerson(name="random-user") | ||
151 | 285 | user_with_permission = self.factory.makePerson() | ||
152 | 286 | someone_else = self.factory.makePerson() | ||
153 | 287 | repository = self.factory.makeGitRepository() | ||
154 | 288 | [ref] = self.factory.makeGitRefs(repository=repository) | ||
155 | 289 | private_snap = self.factory.makeSnap( | ||
156 | 290 | private=True, name="private-snap", | ||
157 | 291 | owner=private_owner, registrant=private_owner, git_ref=ref) | ||
158 | 292 | with person_logged_in(private_owner): | ||
159 | 293 | private_snap.subscribe(user_with_permission, private_owner) | ||
160 | 294 | self.factory.makeSnap( | ||
161 | 295 | private=False, owner=private_owner, registrant=private_owner, | ||
162 | 296 | git_ref=ref) | ||
163 | 297 | |||
164 | 298 | full_list = """ | ||
165 | 299 | Snap packages for lp:~.* | ||
166 | 300 | Name Owner Registered | ||
167 | 301 | snap-name.* Random-user.* .* | ||
168 | 302 | private-snap.* Random-user.* .*""" | ||
169 | 303 | public_list = """ | ||
170 | 304 | Snap packages for lp:.* | ||
171 | 305 | Name Owner Registered | ||
172 | 306 | snap-name.* Random-user.* .*""" | ||
173 | 307 | |||
174 | 308 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
175 | 309 | full_list, | ||
176 | 310 | self.getMainText(repository, "+snaps", user=private_owner)) | ||
177 | 311 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
178 | 312 | full_list, | ||
179 | 313 | self.getMainText(repository, "+snaps", user=user_with_permission)) | ||
180 | 314 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
181 | 315 | public_list, | ||
182 | 316 | self.getMainText(repository, "+snaps", user=someone_else)) | ||
183 | 317 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
184 | 318 | public_list, self.getMainText(repository, "+snaps", user=None)) | ||
185 | 319 | |||
186 | 320 | def test_git_ref_private_snap_listing(self): | ||
187 | 321 | # Only certain users can see private snaps on git ref listing. | ||
188 | 322 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | ||
189 | 323 | private_owner = self.factory.makePerson(name="random-user") | ||
190 | 324 | user_with_permission = self.factory.makePerson() | ||
191 | 325 | someone_else = self.factory.makePerson() | ||
192 | 326 | repository = self.factory.makeGitRepository() | ||
193 | 327 | [ref] = self.factory.makeGitRefs(repository=repository) | ||
194 | 328 | private_snap = self.factory.makeSnap( | ||
195 | 329 | private=True, name="private-snap", | ||
196 | 330 | owner=private_owner, registrant=private_owner, git_ref=ref) | ||
197 | 331 | with person_logged_in(private_owner): | ||
198 | 332 | private_snap.subscribe(user_with_permission, private_owner) | ||
199 | 333 | self.factory.makeSnap( | ||
200 | 334 | private=False, owner=private_owner, registrant=private_owner, | ||
201 | 335 | git_ref=ref) | ||
202 | 336 | |||
203 | 337 | full_list = """ | ||
204 | 338 | Snap packages for ~.*:.* | ||
205 | 339 | Name Owner Registered | ||
206 | 340 | snap-name.* Random-user.* .* | ||
207 | 341 | private-snap.* Random-user.* .*""" | ||
208 | 342 | public_list = """ | ||
209 | 343 | Snap packages for ~.*:.* | ||
210 | 344 | Name Owner Registered | ||
211 | 345 | snap-name.* Random-user.* .*""" | ||
212 | 346 | |||
213 | 347 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
214 | 348 | full_list, self.getMainText(ref, "+snaps", user=private_owner)) | ||
215 | 349 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
216 | 350 | full_list, | ||
217 | 351 | self.getMainText(ref, "+snaps", user=user_with_permission)) | ||
218 | 352 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
219 | 353 | public_list, self.getMainText(ref, "+snaps", user=someone_else)) | ||
220 | 354 | self.assertTextMatchesExpressionIgnoreWhitespace( | ||
221 | 355 | public_list, self.getMainText(ref, "+snaps", user=None)) | ||
222 | 356 | |||
223 | 157 | def assertSnapsQueryCount(self, context, item_creator): | 357 | def assertSnapsQueryCount(self, context, item_creator): |
224 | 158 | self.pushConfig("launchpad", default_batch_size=10) | 358 | self.pushConfig("launchpad", default_batch_size=10) |
225 | 159 | recorder1, recorder2 = record_two_runs( | 359 | recorder1, recorder2 = record_two_runs( |
226 | diff --git a/lib/lp/snappy/model/snap.py b/lib/lp/snappy/model/snap.py | |||
227 | index 287ccc3..b101e18 100644 | |||
228 | --- a/lib/lp/snappy/model/snap.py | |||
229 | +++ b/lib/lp/snappy/model/snap.py | |||
230 | @@ -1438,7 +1438,8 @@ class SnapSet: | |||
231 | 1438 | raise NoSuchSnap(name) | 1438 | raise NoSuchSnap(name) |
232 | 1439 | return snap | 1439 | return snap |
233 | 1440 | 1440 | ||
235 | 1441 | def _getSnapsFromCollection(self, collection, owner=None): | 1441 | def _getSnapsFromCollection(self, collection, owner=None, |
236 | 1442 | visible_by_user=None): | ||
237 | 1442 | if IBranchCollection.providedBy(collection): | 1443 | if IBranchCollection.providedBy(collection): |
238 | 1443 | id_column = Snap.branch_id | 1444 | id_column = Snap.branch_id |
239 | 1444 | ids = collection.getBranchIds() | 1445 | ids = collection.getBranchIds() |
240 | @@ -1448,6 +1449,7 @@ class SnapSet: | |||
241 | 1448 | expressions = [id_column.is_in(ids._get_select())] | 1449 | expressions = [id_column.is_in(ids._get_select())] |
242 | 1449 | if owner is not None: | 1450 | if owner is not None: |
243 | 1450 | expressions.append(Snap.owner == owner) | 1451 | expressions.append(Snap.owner == owner) |
244 | 1452 | expressions.append(get_snap_privacy_filter(visible_by_user)) | ||
245 | 1451 | return IStore(Snap).find(Snap, *expressions) | 1453 | return IStore(Snap).find(Snap, *expressions) |
246 | 1452 | 1454 | ||
247 | 1453 | def findByIds(self, snap_ids, visible_by_user=None): | 1455 | def findByIds(self, snap_ids, visible_by_user=None): |
248 | @@ -1465,8 +1467,10 @@ class SnapSet: | |||
249 | 1465 | """See `ISnapSet`.""" | 1467 | """See `ISnapSet`.""" |
250 | 1466 | def _getSnaps(collection): | 1468 | def _getSnaps(collection): |
251 | 1467 | collection = collection.visibleByUser(visible_by_user) | 1469 | collection = collection.visibleByUser(visible_by_user) |
254 | 1468 | owned = self._getSnapsFromCollection(collection.ownedBy(person)) | 1470 | owned = self._getSnapsFromCollection( |
255 | 1469 | packaged = self._getSnapsFromCollection(collection, owner=person) | 1471 | collection.ownedBy(person), visible_by_user=visible_by_user) |
256 | 1472 | packaged = self._getSnapsFromCollection( | ||
257 | 1473 | collection, owner=person, visible_by_user=visible_by_user) | ||
258 | 1470 | return owned.union(packaged) | 1474 | return owned.union(packaged) |
259 | 1471 | 1475 | ||
260 | 1472 | bzr_collection = removeSecurityProxy(getUtility(IAllBranches)) | 1476 | bzr_collection = removeSecurityProxy(getUtility(IAllBranches)) |
261 | @@ -1481,28 +1485,35 @@ class SnapSet: | |||
262 | 1481 | """See `ISnapSet`.""" | 1485 | """See `ISnapSet`.""" |
263 | 1482 | def _getSnaps(collection): | 1486 | def _getSnaps(collection): |
264 | 1483 | return self._getSnapsFromCollection( | 1487 | return self._getSnapsFromCollection( |
266 | 1484 | collection.visibleByUser(visible_by_user)) | 1488 | collection.visibleByUser(visible_by_user), |
267 | 1489 | visible_by_user=visible_by_user) | ||
268 | 1485 | 1490 | ||
269 | 1486 | bzr_collection = removeSecurityProxy(IBranchCollection(project)) | 1491 | bzr_collection = removeSecurityProxy(IBranchCollection(project)) |
270 | 1487 | git_collection = removeSecurityProxy(IGitCollection(project)) | 1492 | git_collection = removeSecurityProxy(IGitCollection(project)) |
271 | 1488 | return _getSnaps(bzr_collection).union(_getSnaps(git_collection)) | 1493 | return _getSnaps(bzr_collection).union(_getSnaps(git_collection)) |
272 | 1489 | 1494 | ||
274 | 1490 | def findByBranch(self, branch): | 1495 | def findByBranch(self, branch, visible_by_user=None): |
275 | 1491 | """See `ISnapSet`.""" | 1496 | """See `ISnapSet`.""" |
277 | 1492 | return IStore(Snap).find(Snap, Snap.branch == branch) | 1497 | return IStore(Snap).find( |
278 | 1498 | Snap, | ||
279 | 1499 | Snap.branch == branch, | ||
280 | 1500 | get_snap_privacy_filter(visible_by_user)) | ||
281 | 1493 | 1501 | ||
283 | 1494 | def findByGitRepository(self, repository, paths=None): | 1502 | def findByGitRepository(self, repository, paths=None, |
284 | 1503 | visible_by_user=None): | ||
285 | 1495 | """See `ISnapSet`.""" | 1504 | """See `ISnapSet`.""" |
286 | 1496 | clauses = [Snap.git_repository == repository] | 1505 | clauses = [Snap.git_repository == repository] |
287 | 1497 | if paths is not None: | 1506 | if paths is not None: |
288 | 1498 | clauses.append(Snap.git_path.is_in(paths)) | 1507 | clauses.append(Snap.git_path.is_in(paths)) |
289 | 1508 | clauses.append(get_snap_privacy_filter(visible_by_user)) | ||
290 | 1499 | return IStore(Snap).find(Snap, *clauses) | 1509 | return IStore(Snap).find(Snap, *clauses) |
291 | 1500 | 1510 | ||
293 | 1501 | def findByGitRef(self, ref): | 1511 | def findByGitRef(self, ref, visible_by_user=None): |
294 | 1502 | """See `ISnapSet`.""" | 1512 | """See `ISnapSet`.""" |
295 | 1503 | return IStore(Snap).find( | 1513 | return IStore(Snap).find( |
296 | 1504 | Snap, | 1514 | Snap, |
298 | 1505 | Snap.git_repository == ref.repository, Snap.git_path == ref.path) | 1515 | Snap.git_repository == ref.repository, Snap.git_path == ref.path, |
299 | 1516 | get_snap_privacy_filter(visible_by_user)) | ||
300 | 1506 | 1517 | ||
301 | 1507 | def findByContext(self, context, visible_by_user=None, order_by_date=True): | 1518 | def findByContext(self, context, visible_by_user=None, order_by_date=True): |
302 | 1508 | if IPerson.providedBy(context): | 1519 | if IPerson.providedBy(context): |
303 | @@ -1510,16 +1521,13 @@ class SnapSet: | |||
304 | 1510 | elif IProduct.providedBy(context): | 1521 | elif IProduct.providedBy(context): |
305 | 1511 | snaps = self.findByProject( | 1522 | snaps = self.findByProject( |
306 | 1512 | context, visible_by_user=visible_by_user) | 1523 | context, visible_by_user=visible_by_user) |
307 | 1513 | # XXX cjwatson 2015-09-15: At the moment we can assume that if you | ||
308 | 1514 | # can see the source context then you can see the snap packages | ||
309 | 1515 | # based on it. This will cease to be true if snap packages gain | ||
310 | 1516 | # privacy of their own. | ||
311 | 1517 | elif IBranch.providedBy(context): | 1524 | elif IBranch.providedBy(context): |
313 | 1518 | snaps = self.findByBranch(context) | 1525 | snaps = self.findByBranch(context, visible_by_user=visible_by_user) |
314 | 1519 | elif IGitRepository.providedBy(context): | 1526 | elif IGitRepository.providedBy(context): |
316 | 1520 | snaps = self.findByGitRepository(context) | 1527 | snaps = self.findByGitRepository( |
317 | 1528 | context, visible_by_user=visible_by_user) | ||
318 | 1521 | elif IGitRef.providedBy(context): | 1529 | elif IGitRef.providedBy(context): |
320 | 1522 | snaps = self.findByGitRef(context) | 1530 | snaps = self.findByGitRef(context, visible_by_user=visible_by_user) |
321 | 1523 | else: | 1531 | else: |
322 | 1524 | raise BadSnapSearchContext(context) | 1532 | raise BadSnapSearchContext(context) |
323 | 1525 | if order_by_date: | 1533 | if order_by_date: |