<commit_before>!define TEST_SYSTEM {slim}

!3 Generate Random Variables 
!|Table: Rest Fixture | $baseURL |
|let|sName|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|sName2|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|sName3|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|createPostName|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|updatedName|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|iName|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||

!3 Create Sample
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$createPostName" }|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study |200|  Content-Type: application/json ||
|let|sampleId|js|response.jsonbody.response[0].result[0].id||

!3 Create Dummy Sample
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$sName3" }|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study |200|  Content-Type: application/json ||
|let|dummySample|js|response.jsonbody.response[0].result[0].id||

!3 Get Project Release 
!|Table: Rest Fixture | $baseURL |
| setHeader|Content-Type:application/json|
| GET | /v1/projects/$projectId/info?sid=$sessionId |200|  Content-Type: application/json ||
| let | releaseNumber | js | response.jsonbody.response[0].result[0].currentRelease||

!3 Increment Project Release 
!|Table: Rest Fixture | $baseURL |
| setHeader|Content-Type:application/json|
| POST | /v1/projects/$projectId/increlease?sid=$sessionId |200|  Content-Type: application||
| let | currentRelease | js | $releaseNumber + 1||

!3 Create Second Sample Including Individual And Annotation (Deprecated)
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$sName2", "individual" : {"name":"$iName"}, "annotationSets":[{"name": "string", "variableSet": "$gVariableSetId",  "annotations": {"var_int": "10"}}]}|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study&lazy=false |200|  Content-Type: application/json ||
|let|sampleId2|js|response.jsonbody.response[0].result[0].id||
|let||js|response.jsonbody.response[0].result[0].annotationSets[0].annotations[1].value|10|

!3 Search Individual Created Inside the Sample Using Individual Name
!|Table: Rest Fixture | $baseURL |
| GET | /v1/individuals/search?sid=$sessionId&study=$study&name=$iName|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == '$iName'|
|let|individualId|js|response.jsonbody.response[0].result[0].id||

!3 (Negative) Create Sample Including Individual And Annotation With Invalid Variable Set 
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$sName3", "individual" : {"name":"$iName"}, "annotationSets":[{"name": "string", "variableSet": "variableSetId",  "annotations": {"var_int": "10"}}]}|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study |500|  Content-Type: application/json ||

!3 (Negative) Create Sample Including Annotation With Missing Mandatory Variable
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$sName3", "individual" : {"name":"$iName"}, "annotationSets":[{"name": "string", "variableSet": "$gVariableSetId",  "annotations": {"var_double": "100.5"}}]}|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study |500|  Content-Type: application/json |jsonbody.error == 'Missing required variable var_int'|

!3 Get Sample 
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info?sid=$sessionId|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId'|

!3 Get Sample Including Individual
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId2/info?sid=$sessionId&includeIndividual=true|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId2' && jsonbody.response[0].result[0].individual.id == '$individualId'|

!3 Get Individual 
!|Table: Rest Fixture | $baseURL |
| GET | /v1/individuals/$individualId/info?sid=$sessionId|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$individualId'|

!3 Get Multiple Samples
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,$sampleId2/info?sid=$sessionId&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId' && jsonbody.response[1].result[0].id == '$sampleId2'|

!3 Get Multiple Samples In Reverse Order
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId2,$sampleId/info?sid=$sessionId&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId2' && jsonbody.response[1].result[0].id == '$sampleId'|

!3 Get Multiple Samples With One Invalid Entry
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,dummy,$sampleId2/info?sid=$sessionId&study=$study|500|  Content-Type: application/json |jsonbody.error == 'Found only 2 out of the 3 samples looked for in study $study'|

!3 Get Multiple Samples With One Invalid Entry And Silent True
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,$sampleId2,0000/info?sid=$sessionId&study=$study&silent=true|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId' && jsonbody.response[1].result[0].id == '$sampleId2' &&  jsonbody.response[2].errorMsg == "org.opencb.opencga.catalog.exceptions.CatalogAuthorizationException: Permission denied. User '$user' cannot VIEW Sample { id: -1 }"|

!3 Update Sample Without Version Increment
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "newName" }|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/$sampleId/update?sid=$sessionId&incVersion=false |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == 'newName'|

!3 Update Sample With Version Increment
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$updatedName" }|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/$sampleId/update?sid=$sessionId&incVersion=true |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == '$updatedName' && jsonbody.response[0].result[0].version == '2'|

!3 Update Only Sample Version
!|Table: Rest Fixture | $baseURL |
| setBody | {}|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/$sampleId/update?sid=$sessionId&incVersion=true |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].version == '3'|

!3 Get Sample Returns Latest Version
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info?sid=$sessionId|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == '$updatedName' && jsonbody.response[0].result[0].version == '3'|

!3 Search Sample Returns Latest Version
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/search?sid=$sessionId&name=$updatedName&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == '$updatedName' && jsonbody.response[0].result[0].version == '3'|

!3 Get Sample (All Versions)
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info?sid=$sessionId&allVersions=true|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result.length == 3|

!3 Get Samples as Groups
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/groupBy?sid=$sessionId&study=$study&fields=name%2Csource&limit=5|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].numResults > '0' && jsonbody.response[0].result[0]._id.name != ''|

!3 Get Sample ACL
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/acl?sid=$sessionId|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result ==''|

!3 Create Sample ACL
!|Table: Rest Fixture | $baseURL |
|setBody|{"permissions": "DELETE", "action":"SET", "sample": "$sampleId"}|
|setHeader|Content-Type:application/json|
|POST| /v1/samples/acl/$userA/update?sid=$sessionId |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].permissions[0] == 'DELETE'|

!3 Update Sample ACL (add)
!|Table: Rest Fixture | $baseURL |
|setBody|{"add": "VIEW"}|
|setHeader|Content-Type:application/json|
|POST| /v1/samples/$sampleId/acl/$userA/update?sid=$sessionId |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].permissions[0] == 'VIEW'|

!3 Get Samples ACL
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,$sampleId2/acl?sid=$sessionId&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result.length == "1.0" && jsonbody.response[1].result.length == "0.0" |

!3 Get Samples ACL In Reverse Order
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId2,$sampleId/acl?sid=$sessionId&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result.length == "0.0" && jsonbody.response[1].result.length == "1.0" |

!3 Get Samples ACL With One Invalid ID Silent False
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,invalid,$sampleId2/acl?sid=$sessionId&study=$study|500|  Content-Type: application/json |jsonbody.error == "Found only 2 out of the 3 samples looked for in study $study"|<commit_msg>Test: added tests for sample anonymous<commit_after>!define TEST_SYSTEM {slim}

!3 Generate Random Variables 
!|Table: Rest Fixture | $baseURL |
|let|sName|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|sName2|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|sName3|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|createPostName|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|updatedName|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||
|let|iName|js|Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)||

!3 Create Sample
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$createPostName" }|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study |200|  Content-Type: application/json ||
|let|sampleId|js|response.jsonbody.response[0].result[0].id||

!3 Create Dummy Sample
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$sName3" }|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study |200|  Content-Type: application/json ||
|let|dummySample|js|response.jsonbody.response[0].result[0].id||

!3 Get Project Release 
!|Table: Rest Fixture | $baseURL |
| setHeader|Content-Type:application/json|
| GET | /v1/projects/$projectId/info?sid=$sessionId |200|  Content-Type: application/json ||
| let | releaseNumber | js | response.jsonbody.response[0].result[0].currentRelease||

!3 Increment Project Release 
!|Table: Rest Fixture | $baseURL |
| setHeader|Content-Type:application/json|
| POST | /v1/projects/$projectId/increlease?sid=$sessionId |200|  Content-Type: application||
| let | currentRelease | js | $releaseNumber + 1||

!3 Create Second Sample Including Individual And Annotation (Deprecated)
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$sName2", "individual" : {"name":"$iName"}, "annotationSets":[{"name": "string", "variableSet": "$gVariableSetId",  "annotations": {"var_int": "10"}}]}|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study&lazy=false |200|  Content-Type: application/json ||
|let|sampleId2|js|response.jsonbody.response[0].result[0].id||
|let||js|response.jsonbody.response[0].result[0].annotationSets[0].annotations[1].value|10|

!3 Search Individual Created Inside the Sample Using Individual Name
!|Table: Rest Fixture | $baseURL |
| GET | /v1/individuals/search?sid=$sessionId&study=$study&name=$iName|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == '$iName'|
|let|individualId|js|response.jsonbody.response[0].result[0].id||

!3 (Negative) Create Sample Including Individual And Annotation With Invalid Variable Set 
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$sName3", "individual" : {"name":"$iName"}, "annotationSets":[{"name": "string", "variableSet": "variableSetId",  "annotations": {"var_int": "10"}}]}|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study |500|  Content-Type: application/json ||

!3 (Negative) Create Sample Including Annotation With Missing Mandatory Variable
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$sName3", "individual" : {"name":"$iName"}, "annotationSets":[{"name": "string", "variableSet": "$gVariableSetId",  "annotations": {"var_double": "100.5"}}]}|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/create?sid=$sessionId&study=$study |500|  Content-Type: application/json |jsonbody.error == 'Missing required variable var_int'|

!3 Get Sample 
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info?sid=$sessionId|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId'|

!3 Get Sample Including Individual
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId2/info?sid=$sessionId&includeIndividual=true|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId2' && jsonbody.response[0].result[0].individual.id == '$individualId'|

!3 Get Individual 
!|Table: Rest Fixture | $baseURL |
| GET | /v1/individuals/$individualId/info?sid=$sessionId|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$individualId'|

!3 Get Multiple Samples
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,$sampleId2/info?sid=$sessionId&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId' && jsonbody.response[1].result[0].id == '$sampleId2'|

!3 Get Multiple Samples In Reverse Order
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId2,$sampleId/info?sid=$sessionId&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId2' && jsonbody.response[1].result[0].id == '$sampleId'|

!3 Get Multiple Samples With One Invalid Entry
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,dummy,$sampleId2/info?sid=$sessionId&study=$study|500|  Content-Type: application/json |jsonbody.error == 'Found only 2 out of the 3 samples looked for in study $study'|

!3 Get Multiple Samples With One Invalid Entry And Silent True
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,$sampleId2,0000/info?sid=$sessionId&study=$study&silent=true|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId' && jsonbody.response[1].result[0].id == '$sampleId2' &&  jsonbody.response[2].errorMsg == "org.opencb.opencga.catalog.exceptions.CatalogAuthorizationException: Permission denied. User '$user' cannot VIEW Sample { id: -1 }"|

!3 Update Sample Without Version Increment
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "newName" }|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/$sampleId/update?sid=$sessionId&incVersion=false |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == 'newName'|

!3 Update Sample With Version Increment
!|Table: Rest Fixture | $baseURL |
| setBody | {"name" : "$updatedName" }|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/$sampleId/update?sid=$sessionId&incVersion=true |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == '$updatedName' && jsonbody.response[0].result[0].version == '2'|

!3 Update Only Sample Version
!|Table: Rest Fixture | $baseURL |
| setBody | {}|
| setHeader|Content-Type:application/json|
| POST | /v1/samples/$sampleId/update?sid=$sessionId&incVersion=true |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].version == '3'|

!3 Get Sample Returns Latest Version
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info?sid=$sessionId|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == '$updatedName' && jsonbody.response[0].result[0].version == '3'|

!3 Search Sample Returns Latest Version
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/search?sid=$sessionId&name=$updatedName&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].name == '$updatedName' && jsonbody.response[0].result[0].version == '3'|

!3 Get Sample (All Versions)
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info?sid=$sessionId&allVersions=true|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result.length == 3|

!3 Get Samples as Groups
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/groupBy?sid=$sessionId&study=$study&fields=name%2Csource&limit=5|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].numResults > '0' && jsonbody.response[0].result[0]._id.name != ''|

!3 Get Sample As anonymous
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info|403| Content-Type: application/json |jsonbody.error != ''|

!3 Create VIEW_SAMPLE ACL For Study
!|Table: Rest Fixture | $baseURL |
| setBody | {  "permissions" : "VIEW_SAMPLES",  "action": "SET",  "study": "$studyId"}|
| setHeader|Content-Type:application/json|
| POST | /v1/studies/acl/*/update?sid=$sessionId|200|Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].permissions[0] == 'VIEW_SAMPLES'|

!3 Get Sample As Ananomous
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info |200|Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId'|

!3 Delete VIEW_SAMPLE ACL For Study
!|Table: Rest Fixture | $baseURL |
| setBody | {  "permissions" : "VIEW_SAMPLES",  "action": "REMOVE",  "study": "$studyId"}|
| setHeader|Content-Type:application/json|
| POST | /v1/studies/acl/*/update?sid=$sessionId|200|Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].permissions.length == '0.0'|

!3 Get Sample As Ananomous
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info|403|Content-Type: application/json |jsonbody.error == "Permission denied. User '\*'\ cannot VIEW Sample { id: $sampleId }"|

!3 Create Sample ACL For Ananomous
!|Table: Rest Fixture | $baseURL |
|setBody|{"permissions": "VIEW", "action":"SET", "sample": "$sampleId"}|
|setHeader|Content-Type:application/json|
|POST| /v1/samples/acl/*/update?sid=$sessionId |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].permissions[0] == 'VIEW'|

!3 Get Sample As Ananomous
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId'|

!3 Search Sample As Ananomous
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/search?study=$study&name=$updatedName|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].id == '$sampleId'|

!3 Delete Sample ACL For Ananomous
!|Table: Rest Fixture | $baseURL |
|setBody|{"permissions": "VIEW", "action":"REMOVE", "sample": "$sampleId"}|
|setHeader|Content-Type:application/json|
|POST| /v1/samples/acl/*/update?sid=$sessionId |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].permissions.length == '0.0'|

!3 Get Sample As Ananomous
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/info|403|Content-Type: application/json |jsonbody.error == "Permission denied. User '\*'\ cannot VIEW Sample { id: $sampleId }"|

!3 Search Sample As Ananomous
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/search?study=$study&name=$updatedName|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result.length == '0.0'|

!3 Delete Sample ACL For Ananomous
!|Table: Rest Fixture | $baseURL |
|setBody|{"action":"RESET", "sample": "$sampleId"}|
|setHeader|Content-Type:application/json|
|POST| /v1/samples/acl/*/update?sid=$sessionId |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result.length == '0.0'|

!3 Get Sample ACL
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId/acl?sid=$sessionId|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result ==''|

!3 Create Sample ACL
!|Table: Rest Fixture | $baseURL |
|setBody|{"permissions": "DELETE", "action":"SET", "sample": "$sampleId"}|
|setHeader|Content-Type:application/json|
|POST| /v1/samples/acl/$userA/update?sid=$sessionId |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].permissions[0] == 'DELETE'|

!3 Update Sample ACL (add)
!|Table: Rest Fixture | $baseURL |
|setBody|{"add": "VIEW"}|
|setHeader|Content-Type:application/json|
|POST| /v1/samples/$sampleId/acl/$userA/update?sid=$sessionId |200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result[0].permissions[0] == 'VIEW'|

!3 Get Samples ACL
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,$sampleId2/acl?sid=$sessionId&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result.length == "1.0" && jsonbody.response[1].result.length == "0.0" |

!3 Get Samples ACL In Reverse Order
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId2,$sampleId/acl?sid=$sessionId&study=$study|200|  Content-Type: application/json |jsonbody.error == '' && jsonbody.response[0].result.length == "0.0" && jsonbody.response[1].result.length == "1.0" |

!3 Get Samples ACL With One Invalid ID Silent False
!|Table: Rest Fixture | $baseURL |
| GET | /v1/samples/$sampleId,invalid,$sampleId2/acl?sid=$sessionId&study=$study|500|  Content-Type: application/json |jsonbody.error == "Found only 2 out of the 3 samples looked for in study $study"|
{'fraction_non_alphanumeric': 0.19234828496042217, 'fraction_numerical': 0.02911169744942832, 'mean_word_length': 6.102123672704559, 'pattern_counts': {'":': 56, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5567353', 'n_tokens_mistral': 8101, 'n_tokens_neox': 7698, 'n_words': 1518}