!--a11y-->
Testing the Access Protection 
You can now test the role assignments. For this test, you will log on to the application using each of the users. An error message should appear if the role assignment for the user does not allow him or her perform the corresponding action. See the table below.
Users and Corresponding Authorizations
User |
Permitted Tasks |
Non-Permitted Tasks |
Pr_Agent |
● View reservations ● Create and cancel reservations for all vehicle types |
Not applicable |
Agent |
● View reservations ● Create and cancel reservations for the vehicle types: ¡ Economy ¡ Compact ¡ Intermediate ¡ Full Size ¡ Mini Van |
Not allowed to create or cancel reservations for the vehicle types: · Premium · Luxury |
Employee |
View reservations |
Not allowed to create or cancel reservations |
|
|
The AS Java is running. |
|
|
You have completed the tutorial steps and assigned the roles to the users. |
...
1. To make sure that all sessions are cleared, close any open Web browsers and start a new one.
2. Access the Web Dynpro car rental application.

http://localhost:50000/webdynpro/dispatcher/local/TutWD_CarRental/CarRentalApp/

You can also start the application from the SAP NetWeaver Developer Studio. In the Web Dynpro Explorer, expand TutWD_CarRental ® Web Dynpro ®Applications. Choose Run from the context menu for the CarRentalApp application.
3. Log on to the application as the user Pr_Agent. (If necessary, change the initial password.)
4. Create a reservation using the vehicle type Economy.
This reservation is created.

Use the function Display all Bookings to refresh the list.
5. Create a reservation using the vehicle type Luxury or Premium.
This reservation is also created.
6. Create and cancel additional reservations.
All attempts should be successful.
When you are finished, make sure you have at least one reservation with a standard vehicle type and one with a premium or luxury vehicle type.
7. Close the Web browser.
Repeat these steps for the user Agent. Agent should be able to create and cancel reservations for all vehicle types except for Premium and Luxury.
...
1. Start a new Web browser.
2. Access the Web Dynpro car rental application again.
3. Log on to the application as the user Agent. (If necessary, change the initial password.)
4. Create a reservation using the vehicle type Economy.
This reservation is created.
5. Attempt to create a reservation using the vehicle type Luxury or Premium.
You receive an error.
6. Attempt to cancel a reservation that you created in the first test that has the luxury or premium vehicle type.
You receive an error.
7. Close the Web browser.
Repeat these steps for the user Employee. Employee should be able to view the existing reservations, but should not be able to create or cancel any reservations.
...
1. Start a new Web browser.
2. Access the Web Dynpro car rental application.
3. Log on to the application as the user Employee. (If necessary, change the initial password.)
4. Attempt to create or cancel car reservations.
You receive errors.
5. Close the Web browser.
You have protected access to the quick car rental application using UME permissions, actions and roles.
If you want to continue with the optional step of adding a permission check in the Web Dynpro client, then see Checking Permissions in the Web Dynpro Frontend Client.