@@ -69,7 +69,7 @@ describe('api: /projects', () => {
6969 . set ( 'X-Extended-Metadata' , 'true' )
7070 . expect ( 200 )
7171 . then ( ( { body } ) => {
72- body . verbs . length . should . be . greaterThan ( 39 ) ;
72+ body . verbs . length . should . equal ( 46 ) ;
7373 body . should . be . a . Project ( ) ;
7474 body . name . should . equal ( 'Default Project' ) ;
7575 } ) ) ) ) ) ) ;
@@ -370,7 +370,7 @@ describe('api: /projects', () => {
370370 . expect ( 200 )
371371 . then ( ( { body } ) => {
372372 body . verbs . should . be . an . Array ( ) ;
373- body . verbs . length . should . be . greaterThan ( 39 ) ;
373+ body . verbs . length . should . equal ( 46 ) ;
374374 body . verbs . should . containDeep ( [ 'user.password.invalidate' , 'project.delete' ] ) ;
375375 } ) ) ) ) ;
376376
@@ -381,7 +381,7 @@ describe('api: /projects', () => {
381381 . expect ( 200 )
382382 . then ( ( { body } ) => {
383383 body . verbs . should . be . an . Array ( ) ;
384- body . verbs . length . should . be . lessThan ( 28 ) ;
384+ body . verbs . length . should . equal ( 31 ) ;
385385 body . verbs . should . containDeep ( [ 'assignment.create' , 'project.delete' , 'dataset.list' ] ) ;
386386 body . verbs . should . not . containDeep ( [ 'project.create' ] ) ;
387387 } ) ) ) ) ;
@@ -398,13 +398,11 @@ describe('api: /projects', () => {
398398 . expect ( 200 )
399399 . then ( ( { body } ) => {
400400 body . verbs . should . eqlInAnyOrder ( [
401- // eslint-disable-next-line no-multi-spaces
402- 'project.read' , // from role(s): formfill
403- // eslint-disable-next-line no-multi-spaces
404- 'form.list' , // from role(s): formfill
405- // eslint-disable-next-line no-multi-spaces
406- 'form.read' , // from role(s): formfill
407- 'submission.create' , // from role(s): formfill
401+ // following verbs from role: formfill
402+ 'project.read' ,
403+ 'form.list' ,
404+ 'form.read' ,
405+ 'submission.create' ,
408406 ] ) ;
409407 } ) ) ) ) ) ) ;
410408
@@ -422,21 +420,19 @@ describe('api: /projects', () => {
422420 . expect ( 200 )
423421 . then ( ( { body } ) => {
424422 body . verbs . should . eqlInAnyOrder ( [
425- // eslint-disable-next-line no-multi-spaces
426- 'project.read' , // from role(s): formfill, viewer
427- // eslint-disable-next-line no-multi-spaces
428- 'form.list' , // from role(s): formfill, viewer
429- // eslint-disable-next-line no-multi-spaces
430- 'form.read' , // from role(s): formfill, viewer
431- // eslint-disable-next-line no-multi-spaces
432- 'submission.read' , // from role(s): viewer
433- // eslint-disable-next-line no-multi-spaces
434- 'submission.list' , // from role(s): viewer
435- 'submission.create' , // from role(s): formfill
436- // eslint-disable-next-line no-multi-spaces
437- 'dataset.list' , // from role(s): viewer
438- // eslint-disable-next-line no-multi-spaces
439- 'entity.list' , // from role(s): viewer
423+ // following roles from formfill + viewer:
424+ 'project.read' ,
425+ 'form.list' ,
426+ 'form.read' ,
427+ // following roles from formfill only:
428+ 'submission.create' ,
429+ // following roles from viewer only:
430+ 'submission.read' ,
431+ 'submission.list' ,
432+ 'dataset.list' ,
433+ 'dataset.read' ,
434+ 'entity.list' ,
435+ 'entity.read'
440436 ] ) ;
441437 } ) ) ) ) ) ) ;
442438 } ) ;
@@ -1330,7 +1326,7 @@ describe('api: /projects?forms=true', () => {
13301326 body . length . should . equal ( 1 ) ;
13311327 body [ 0 ] . should . be . a . Project ( ) ;
13321328 const { formList, verbs } = body [ 0 ] ;
1333- verbs . length . should . equal ( 42 ) ;
1329+ verbs . length . should . equal ( 46 ) ;
13341330 formList . length . should . equal ( 2 ) ;
13351331 const form = formList [ 0 ] ;
13361332 form . should . be . a . ExtendedForm ( ) ;
@@ -1394,7 +1390,7 @@ describe('api: /projects?forms=true', () => {
13941390 body . length . should . equal ( 2 ) ;
13951391 // First project
13961392 body [ 0 ] . formList . length . should . equal ( 2 ) ;
1397- body [ 0 ] . verbs . length . should . equal ( 27 ) ;
1393+ body [ 0 ] . verbs . length . should . equal ( 31 ) ;
13981394 // Second project
13991395 body [ 1 ] . formList . length . should . equal ( 1 ) ;
14001396 body [ 1 ] . verbs . length . should . be . lessThan ( 5 ) ; // 4 for data collector
@@ -1439,21 +1435,19 @@ describe('api: /projects?forms=true', () => {
14391435 body . length . should . equal ( 1 ) ;
14401436 const { verbs } = body [ 0 ] ;
14411437 verbs . should . eqlInAnyOrder ( [
1442- // eslint-disable-next-line no-multi-spaces
1443- 'form.list' , // from role(s): formfill, viewer
1444- // eslint-disable-next-line no-multi-spaces
1445- 'form.read' , // from role(s): formfill, viewer
1446- // eslint-disable-next-line no-multi-spaces
1447- 'project.read' , // from role(s): formfill, viewer
1448- 'submission.create' , // from role(s): formfill
1449- // eslint-disable-next-line no-multi-spaces
1450- 'submission.list' , // from role(s): viewer
1451- // eslint-disable-next-line no-multi-spaces
1452- 'submission.read' , // from role(s): viewer
1453- // eslint-disable-next-line no-multi-spaces
1454- 'dataset.list' , // from role(s): viewer
1455- // eslint-disable-next-line no-multi-spaces
1456- 'entity.list' // from role(s): viewer
1438+ // following roles from formfill + viewer:
1439+ 'project.read' ,
1440+ 'form.list' ,
1441+ 'form.read' ,
1442+ // following roles from formfill only:
1443+ 'submission.create' ,
1444+ // following roles from viewer only:
1445+ 'submission.read' ,
1446+ 'submission.list' ,
1447+ 'dataset.list' ,
1448+ 'dataset.read' ,
1449+ 'entity.list' ,
1450+ 'entity.read'
14571451 ] ) ;
14581452 } ) ) ) ) ) ) ;
14591453 } ) ;
@@ -1484,21 +1478,19 @@ describe('api: /projects?forms=true', () => {
14841478 const project = body [ 0 ] ;
14851479 project . id . should . equal ( 1 ) ;
14861480 project . verbs . should . eqlInAnyOrder ( [
1487- // eslint-disable-next-line no-multi-spaces
1488- 'project.read' , // from role(s): viewer
1489- // eslint-disable-next-line no-multi-spaces
1490- 'form.list' , // from role(s): viewer
1491- // eslint-disable-next-line no-multi-spaces
1492- 'form.read' , // from role(s): viewer, app-user
1493- // eslint-disable-next-line no-multi-spaces
1494- 'submission.read' , // from role(s): viewer
1495- // eslint-disable-next-line no-multi-spaces
1496- 'submission.list' , // from role(s): viewer
1497- 'submission.create' , // from role(s): app-user
1498- // eslint-disable-next-line no-multi-spaces
1499- 'dataset.list' , // from role(s): viewer
1500- // eslint-disable-next-line no-multi-spaces
1501- 'entity.list' // from role(s): viewer
1481+ // following roles from app-user + viewer:
1482+ 'form.read' ,
1483+ // following roles from app-user only:
1484+ 'submission.create' ,
1485+ // following roles from viewer only:
1486+ 'project.read' ,
1487+ 'form.list' ,
1488+ 'submission.read' ,
1489+ 'submission.list' ,
1490+ 'dataset.list' ,
1491+ 'dataset.read' ,
1492+ 'entity.list' ,
1493+ 'entity.read'
15021494 ] ) ;
15031495 } ) ) ) ) ) ) ;
15041496} ) ;
0 commit comments