Restricted access to GAM Backend

Official Content
This documentation is valid for:

In general, only GAM Repository administrators will be able to execute the GAM Web Backend.

The restriction that only allows authorized users to access the GAM Backend is automatically implemented; the necessary code is automatically included in the Backend objects, as we'll see in this document.

First, set the GAM Examples Integrated Security Level property to "Authentication". The master page used checks that the user has a role that will allow him to access the GAM Backend objects.

To confirm that, edit the "GAMMasterpage" object (it's the MasterPage object of "GamHome" web panel, which is the entry point of GAM Backend) and take a look at the code in the Start Event:

Event Start
    If GAMUser.CheckRoleByExternalId(!"is_gam_administrator")
        Header1.Object= GAMHeader.Create(ContHolder1.Pgmname)
        //OK
    Else
        GAMExampleNotAuthorized.Link()
    Endif    
EndEvent

So, the CheckRoleByExternalId method of the GAMUser object is used to check for the "is_gam_administrator" Role External Id.
By default, the Administrator role (created automatically) has this Role External Id. The Role External Id for the Administrator role is updated in the GAM Applications registration (and in the initialization of the GAM metadata).

Compatibility

Note that in previous versions, the CheckPermission method was used to check if the user had access to the GAM Backend. In that case, the Require Access Permissions Application Property was required to be activated.

Now, this property isn't required because we are checking roles and not permissions.





Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.