@@ -282,10 +282,13 @@ public void testCanReadAndBuildOneOfMyRepositories() throws IOException {
282
282
GithubRequireOrganizationMembershipACL projectAcl = aclForProject (mockProject );
283
283
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
284
284
285
+ assertTrue (projectAcl .hasPermission (authenticationToken , Item .DISCOVER ));
285
286
assertTrue (projectAcl .hasPermission (authenticationToken , Item .READ ));
286
287
assertTrue (projectAcl .hasPermission (authenticationToken , Item .BUILD ));
288
+ assertTrue (workflowJobAcl .hasPermission (authenticationToken , Item .DISCOVER ));
287
289
assertTrue (workflowJobAcl .hasPermission (authenticationToken , Item .READ ));
288
290
assertTrue (workflowJobAcl .hasPermission (authenticationToken , Item .BUILD ));
291
+ assertTrue (multiBranchProjectAcl .hasPermission (authenticationToken , Item .DISCOVER ));
289
292
assertTrue (multiBranchProjectAcl .hasPermission (authenticationToken , Item .READ ));
290
293
assertTrue (multiBranchProjectAcl .hasPermission (authenticationToken , Item .BUILD ));
291
294
}
@@ -312,10 +315,13 @@ public void testCanReadAndBuildOrgRepositoryICollaborateOn() throws IOException
312
315
313
316
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
314
317
318
+ assertTrue (projectAcl .hasPermission (authenticationToken , Item .DISCOVER ));
315
319
assertTrue (projectAcl .hasPermission (authenticationToken , Item .READ ));
316
320
assertTrue (projectAcl .hasPermission (authenticationToken , Item .BUILD ));
321
+ assertTrue (multiBranchProjectAcl .hasPermission (authenticationToken , Item .DISCOVER ));
317
322
assertTrue (multiBranchProjectAcl .hasPermission (authenticationToken , Item .READ ));
318
323
assertTrue (multiBranchProjectAcl .hasPermission (authenticationToken , Item .BUILD ));
324
+ assertTrue (workflowJobAcl .hasPermission (authenticationToken , Item .DISCOVER ));
319
325
assertTrue (workflowJobAcl .hasPermission (authenticationToken , Item .READ ));
320
326
assertTrue (workflowJobAcl .hasPermission (authenticationToken , Item .BUILD ));
321
327
}
@@ -343,10 +349,13 @@ public void testCanReadAndBuildOtherOrgPrivateRepositoryICollaborateOn() throws
343
349
344
350
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
345
351
352
+ assertTrue (projectAcl .hasPermission (authenticationToken , Item .DISCOVER ));
346
353
assertTrue (projectAcl .hasPermission (authenticationToken , Item .READ ));
347
354
assertTrue (projectAcl .hasPermission (authenticationToken , Item .BUILD ));
355
+ assertTrue (multiBranchProjectAcl .hasPermission (authenticationToken , Item .DISCOVER ));
348
356
assertTrue (multiBranchProjectAcl .hasPermission (authenticationToken , Item .READ ));
349
357
assertTrue (multiBranchProjectAcl .hasPermission (authenticationToken , Item .BUILD ));
358
+ assertTrue (workflowJobAcl .hasPermission (authenticationToken , Item .DISCOVER ));
350
359
assertTrue (workflowJobAcl .hasPermission (authenticationToken , Item .READ ));
351
360
assertTrue (workflowJobAcl .hasPermission (authenticationToken , Item .BUILD ));
352
361
}
@@ -366,10 +375,13 @@ public void testCanNotReadOrBuildRepositoryIDoNotCollaborateOn() throws IOExcept
366
375
367
376
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
368
377
378
+ assertFalse (projectAcl .hasPermission (authenticationToken , Item .DISCOVER ));
369
379
assertFalse (projectAcl .hasPermission (authenticationToken , Item .READ ));
370
380
assertFalse (projectAcl .hasPermission (authenticationToken , Item .BUILD ));
381
+ assertFalse (multiBranchProjectAcl .hasPermission (authenticationToken , Item .DISCOVER ));
371
382
assertFalse (multiBranchProjectAcl .hasPermission (authenticationToken , Item .READ ));
372
383
assertFalse (multiBranchProjectAcl .hasPermission (authenticationToken , Item .BUILD ));
384
+ assertFalse (workflowJobAcl .hasPermission (authenticationToken , Item .DISCOVER ));
373
385
assertFalse (workflowJobAcl .hasPermission (authenticationToken , Item .READ ));
374
386
assertFalse (workflowJobAcl .hasPermission (authenticationToken , Item .BUILD ));
375
387
}
@@ -384,6 +396,7 @@ public void testNotGrantedBuildWhenNotUsingGitSCM() throws IOException {
384
396
385
397
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
386
398
399
+ assertFalse (acl .hasPermission (authenticationToken , Item .DISCOVER ));
387
400
assertFalse (acl .hasPermission (authenticationToken , Item .READ ));
388
401
}
389
402
@@ -395,6 +408,7 @@ public void testNotGrantedBuildWhenRepositoryIsEmpty() throws IOException {
395
408
396
409
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
397
410
411
+ assertFalse (acl .hasPermission (authenticationToken , Item .DISCOVER ));
398
412
assertFalse (acl .hasPermission (authenticationToken , Item .READ ));
399
413
}
400
414
@@ -412,6 +426,7 @@ public void testNotGrantedReadWhenRepositoryUrlIsEmpty() throws IOException {
412
426
413
427
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
414
428
429
+ assertFalse (acl .hasPermission (authenticationToken , Item .DISCOVER ));
415
430
assertFalse (acl .hasPermission (authenticationToken , Item .READ ));
416
431
}
417
432
@@ -439,6 +454,7 @@ public void testWithoutUseRepositoryPermissionsSetCanReadDueToAuthenticatedUserR
439
454
440
455
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
441
456
457
+ assertTrue (acl .hasPermission (authenticationToken , Item .DISCOVER ));
442
458
assertTrue (acl .hasPermission (authenticationToken , Item .READ ));
443
459
}
444
460
@@ -452,6 +468,7 @@ public void testWithoutUseRepositoryPermissionsSetCannotReadWithoutToAuthenticat
452
468
453
469
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
454
470
471
+ assertFalse (acl .hasPermission (authenticationToken , Item .DISCOVER ));
455
472
assertFalse (acl .hasPermission (authenticationToken , Item .READ ));
456
473
}
457
474
@@ -490,6 +507,7 @@ public void testCanReadConfigureDeleteAProjectWithAuthenticatedUserReadPermissio
490
507
GithubRequireOrganizationMembershipACL acl = globalAcl .cloneForProject (mockProject );
491
508
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
492
509
510
+ assertTrue (acl .hasPermission (authenticationToken , Item .DISCOVER ));
493
511
assertTrue (acl .hasPermission (authenticationToken , Item .READ ));
494
512
assertTrue (acl .hasPermission (authenticationToken , Item .CONFIGURE ));
495
513
assertTrue (acl .hasPermission (authenticationToken , Item .DELETE ));
@@ -508,6 +526,7 @@ public void testCannotReadConfigureDeleteAProjectWithoutToAuthenticatedUserReadP
508
526
GithubRequireOrganizationMembershipACL acl = globalAcl .cloneForProject (mockProject );
509
527
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
510
528
529
+ assertFalse (acl .hasPermission (authenticationToken , Item .DISCOVER ));
511
530
assertFalse (acl .hasPermission (authenticationToken , Item .READ ));
512
531
assertFalse (acl .hasPermission (authenticationToken , Item .CONFIGURE ));
513
532
assertFalse (acl .hasPermission (authenticationToken , Item .DELETE ));
@@ -526,6 +545,7 @@ public void testCannotReadRepositoryWithInvalidRepoUrl() throws IOException {
526
545
527
546
GithubAuthenticationToken authenticationToken = new GithubAuthenticationToken ("accessToken" , "https://api.github.com" );
528
547
548
+ assertFalse (acl .hasPermission (authenticationToken , Item .DISCOVER ));
529
549
assertFalse (acl .hasPermission (authenticationToken , Item .READ ));
530
550
}
531
551
0 commit comments