Update GAM Application Permissions

Official Content
This documentation is valid for:

The GAMApplication object of GeneXus Access Manager Library provides methods that can be used to add, update, and delete GAM Permissions in the Application.

Before adding Permissions to Users or to Roles, the Permission needs to be added in any of the applications of the Repository.

This can be done using the GAM Backoffice or just programmatically using the GAM API.

AddPermission Method of GAMApplication Object

Syntax

GAMApplication.AddPermission(in:GAMApplicationPermission,out:GAMError Collection) : Boolean

Example

In order to add a new Permission in the Application, you need to define a GAMApplicationPermission object type variable.

&GAMApplicationPermission = new()
&GAMApplicationPermission.Name = 'MyPermission1'
&GAMApplicationPermission.Description = 'MyPermission1'
&GAMApplicationPermission.AccessType = GAMPermissionAccessTypeDefault.Restricted //Possible values are Allow, Deny, Restricted
&isok = &Application.AddPermission(&GAMApplicationPermission,&Errors)
if &isok
   commit
else
   For &Error in &Errors
       Msg(Format(!"%1 (GAM%2)", &Error.Message, &Error.Code))
   EndFor
endif

UpdatePermission Method of GAMApplication Object

Syntax

GAMApplication.UpdatePermission(in:GAMApplicationPermission,out:GAMError Collection) : Boolean

DeletePermission Method of GAMApplication Object

Syntax

GAMApplication.DeletePermission(in:GAMApplicationPermission,out:GAMError Collection) : Boolean