1123: Error message displayed when 403 returned from server

Test Case #: 1123


Test Case Name: Error message displayed when 403 returned from server

System: openLMIS

Subsystem: blue

Test case designed by: Lucyna Laska

Design Date:23.11.2016

Short description

When the OpenLMIS server returns a 403 error (access forbidden) to the client, an error message stating the user doesn't have access is shown.

This ticket is about the UI modal - not the error message being returned from the server.

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

Step

Action

Expected system response

Comment

1

   Log in as administrator to UI and select the Requisitions→Create Authorize.                         

                                                                                                                            

                                                 

2

Select the proper program and show the details of requisition by selecting the PROCEED button.

 

 

3

Remove all roles for the users using API.

URL: http://10.222.17.134/referencedata/api/users?access_token=22b1874e-81f6-4cd3-84cf-322e665b7c0f

Method: PUT

Body:

 {
         "id": "a337ec45-31a0-4f2b-9b2e-a105c4b669bb",
    "username": "administrator",
    "firstName": "Admin",
    "lastName": "Admin",
    "email": "administrator@openlmis.org",
    "timezone": "CET",
    "homeFacility": {
      "code": "HC01",
      "name": "Comfort Health Clinic",
      "geographicZone": {
        "code": "M-So-Bal-Bal",
        "name": "Balaka",
        "level": {
          "code": "City",
          "levelNumber": 4,
          "id": "90e35999-a64f-4312-ba8f-bc13a1311c75"
        },
        "latitude": -14.99,
        "longitude": 34.92,
        "id": "bf2b810b-cdbf-48b2-b569-149b3cf42387"
      },
      "type": {
        "code": "HC",
        "name": "Health Center",
        "displayOrder": 1,
        "active": true,
        "id": "ac1d268b-ce10-455f-bf87-9c667da8f060"
      },
      "operator": {
        "code": "moh",
        "name": "Ministry of Health",
        "displayOrder": 1,
        "id": "9456c3e9-c4a6-4a28-9e08-47ceb16a4121"
      },
      "active": true,
      "enabled": true,
      "openLmisAccessible": true,
      "supportedPrograms": [
        {
          "code": "PRG001",
          "name": "Family Planing",
          "active": true,
          "periodsSkippable": true,
          "showNonFullSupplyTab": true,
          "id": "dce17f2e-af3e-40ad-8e00-3496adef44c3"
        },
        {
          "code": "PRG002",
          "name": "Essential Meds",
          "active": true,
          "periodsSkippable": false,
          "id": "10845cb9-d365-4aaa-badd-b4fa39c6a26a"
        }
      ],
      "id": "e6799d64-d10d-4011-b8c2-0e4d4a3f65ce"
    },
    "verified": true,
    "active": true,
    "loginRestricted": false,
    "roleAssignments": [
    ]

  }

 

All roles has been removed successfully.

 

4

Try to submit requisition without assigned roles.

 It's not possible. Error message: "You are not authorized to perform this action" is displayed.


Tested on Chrome and Firefox.

 

5

   

6

  

 

7

  

 

Post – conditions:

OpenLMIS: the global initiative for powerful LMIS software