Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Test Case #:284


Test Case Name: Refactor hasRight endpoint to check supervision rights by facility

System: openLMIS

Subsystem: blue

Test case designed by: Lucyna Laska

Design Date:21.11.2016

Short description

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

Step

Action

Expected system response

Comment

1

  Check if administrator has an supervisory right assigned to his program and facility.

     URL:

http://10.222.17.134/referencedata/api/users/a337ec45-31a0-4f2b-9b2e-a105c4b669bb/hasRight?rightId=feb4c0b8-f6d2-4289-b29d-811c1d0b2863&programId=10845cb9-d365-4aaa-badd-b4fa39c6a26a&facilityId=e6799d64-d10d-4011-b8c2-0e4d4a3f65ce&access_token=0eff62d7-85a6-4a3f-8c4a-62466e3d0734

                                                                                                                      true                                                     

2

Check if administrator has an orderfulfillment right assigned.

URL:

http://10.222.17.134/referencedata/api/users/a337ec45-31a0-4f2b-9b2e-a105c4b669bb/hasRight?rightId=17c3e414-b608-44ad-b485-9df56a35923d&warehouseId=e6799d64-d10d-4011-b8c2-0e4d4a3f65ce&access_token=0eff62d7-85a6-4a3f-8c4a-62466e3d0734

true


3

Check if administrator has an supervisory right to proper program with wrong facilityId (without access to this)

URL:

http://10.222.17.134/referencedata/api/users/a337ec45-31a0-4f2b-9b2e-a105c4b669bb/hasRight?rightId=feb4c0b8-f6d2-4289-b29d-811c1d0b2863&programId=10845cb9-d365-4aaa-badd-b4fa39c6a26a&facilityId=13037147-1769-4735-90a7-b9b310d128b8&access_token=0eff62d7-85a6-4a3f-8c4a-62466e3d0734

false



Check if administrator has the Order Fulfillmnet right when wrong warehouseID is provided (without access to this).

URL:

http://10.222.17.134/referencedata/api/users/a337ec45-31a0-4f2b-9b2e-a105c4b669bb/hasRight?rightId=17c3e414-b608-44ad-b485-9df56a35923d&warehouseId=19121381-9f3d-4e77-b9e5-d3f59fc1639e&access_token=0eff62d7-85a6-4a3f-8c4a-62466e3d0734

false

Check if administrator can verify his rights when program is definined in request but facility don't.

URL:

http://10.222.17.134/referencedata/api/users/a337ec45-31a0-4f2b-9b2e-a105c4b669bb/hasRight?rightId=feb4c0b8-f6d2-4289-b29d-811c1d0b2863&programId=10845cb9-d365-4aaa-badd-b4fa39c6a26a&access_token=0eff62d7-85a6-4a3f-8c4a-62466e3d0734

error mesage displayed

4

 Check if it possible to check the user rights when parameter rightID is not specified in the request.

URL:

http://10.222.17.134/referencedata/api/users/a337ec45-31a0-4f2b-9b2e-a105c4b669bb/hasRight?access_token=0eff62d7-85a6-4a3f-8c4a-62466e3d0734

no


6

Check if devadmin has the supervision right when rights are not assigned.

URL:

http://10.222.17.134/referencedata/api/users/56a50e9a-9668-437d-a09c-7e709ce22222/hasRight?rightId=feb4c0b8-f6d2-4289-b29d-811c1d0b2863&programId=66032ea8-b69b-4102-a1eb-844e57143187&facilityId=19121381-9f3d-4e77-b9e5-d3f59fc1639e&access_token=0eff62d7-85a6-4a3f-8c4a-62466e3d0734

false

Assign supervision right to devadmin:

{

"id": "56a50e9a-9668-437d-a09c-7e709ce22222",

"username": "devadmin",

"firstName": "Admin",

"lastName": "Admin",

"email": "devadmin@openlmis.org",

"timezone": "CET",

"homeFacility": {

"code": "W01",

"name": "CMST Warehouse",

"geographicZone": {

"code": "Mal-So",

"name": "Southern Region",

"level": {

"code": "Region",

"levelNumber": 2,

"id": "9b497d87-cdd9-400e-bb04-fae0bf6a9491"

},

"id": "0bbd69c1-e20f-48f5-aae4-26dcd8aa7602"

},

"type": {

"code": "WH",

"name": "Warehouse",

"displayOrder": 3,

"active": true,

"id": "e2faaa9e-4b2d-4212-bb60-fd62970b2113"

},

"operator": {

"code": "moh",

"name": "Ministry of Health",

"displayOrder": 1,

"id": "9456c3e9-c4a6-4a28-9e08-47ceb16a4121"

},

"active": true,

"enabled": true,

"openLmisAccessible": true,

"supportedPrograms": [

{

"code": "PRG003",

"name": "New program",

"active": true,

"periodsSkippable": false,

"id": "66032ea8-b69b-4102-a1eb-844e57143187"

}

],

"id": "19121381-9f3d-4e77-b9e5-d3f59fc1639e"

},

"verified": true,

"active": true,

"loginRestricted": false,

"roleAssignments": [

{

"roleId": "d30a2fbb-51d9-49ad-90fe-fb405470a439",

"programCode": "PRG003",

"supervisoryNodeCode": "N3"

}]


}


7

After assigning the supervision right check again, if user has an access now.

URL:

http://10.222.17.134/referencedata/api/users/56a50e9a-9668-437d-a09c-7e709ce22222/hasRight?rightId=feb4c0b8-f6d2-4289-b29d-811c1d0b2863&programId=66032ea8-b69b-4102-a1eb-844e57143187&facilityId=19121381-9f3d-4e77-b9e5-d3f59fc1639e&access_token=0eff62d7-85a6-4a3f-8c4a-62466e3d0734

true


8

                                                


Post – conditions:

  • No labels