Step 6 - Security

First, we must delete de item "Developer menu" in the menu. 

Open the data provider "MenuOptionsData" and delete them.

In another side, we need an item "Backend" for administrating the tables (only for the administrator).

For this, we must add a new item "Backend" in the menu and the subitems with the tables.

ECommerceHowToUse010

Repeat the code for all of the tables.

Run the app and login with the user admin and check the transactions.

ECommerceHowToUse011

Now, It is required to create a specific role in the application security scheme to assign it to the end-users of e-commerce. This role will only have permissions to access the e-commerce screens and may complete the purchase. You should not access the backend of the application.


In the GamRolePermissionsSelect and GamWWRolePermissions Web Panels, modify the Main Object Web User Experience property to the Smooth value.

ECommerceHowToUse013

After that, we need to add a new role "Customer".  

ECommerceHowToUse014

Now, we must add the permissions.

ECommerceHowToUse015

Add only the cartcheckout_Execute functionality for this role:

ECommerceHowToUse016

Open the "GAMRegisterUser" screen and add the code needed to create the user of the application from the created GAM user. This option is interesting for saving information “Extra” of the users that the External Object GAMUser does not allow by default:

ECommerceHowToUse017

Run the application and using the "Register" option enter a new user, and then (by entering again as administrator) assign the “Customer” role to this new user. Enter with the user-created and verify that he effectively only has permissions to access the screens correct.