User Authority Access Service

The documentation only applies if VLF object authority is enabled.

VLF-ONE

VLF-ONE uses a different authority implementation to VLF-WIN because it is web browser based.

In VLF-ONE if a user is not authorized to use an object then it does not exist in the current execution context.

So to test whether a user is authorized to an object you check whether it is available in the current execution context.

This is done by executing the method #avFrameworkManager. avCheckAvailability,

You need to pass the User Object Name / Type of the object as the UserObjectName() parameter.

The result is a Boolean named IsAvailable. 

VLF-WIN

The VLF services manager provides a facility to access the current user's authority to a nominated object. For example, this service can be used to help a component decide whether to enable or disable buttons or switches. It is available only to Windows applications.

In Windows applications the current user's authority to an object is retrieved using the avCheckUserAuthority method.

Method avCheckUserAuthority Parameters
Name Usage

To

Mandatory. Use this parameter to specify the type of the object to be checked. Allowable values are APPLICATION, BUSINESSOBJECT and COMMAND. Values may be specified in any case.

Named

Mandatory. The User Object Name / Type of the object to be checked.

InContext

Optional and required only for commands. Use this parameter to specify The User Object Name / Type of the object the command is associated with. Defaults to the current object.

ReturnValue

Mandatory. Returned as true or false. True means the user has authority to use the object and false means the user doesn't.

 

Examples of Authority Checks on Objects

Check the authority of the current user to the Demo application and return the answer to the variable #STD_BOOL:

Invoke Method(#avFrameworkManager.avCheckUserAuthority) To(APPLICATION) Named(DEMO) ReturnValue(#Std_Bool)

Check the authority of the current user to the Organization business object and return the answer to the variable #STD_BOOL:

Invoke Method(#avFrameworkManager.avCheckUserAuthority) To(BUSINESSOBJECT) Named(DEM_ORG) ReturnValue(#Std_Bool)

Check the authority of the current user to the 'Details' command of the Resources business object and return the answer to the variable #STD_BOOL:

Invoke Method(#avFrameworkManager.avCheckUserAuthority) To(COMMAND) InContext(DEM_ORG_SEC_EMP) Named(DETAILS) ReturnValue(#Std_Bool)

Check the authority of the current user to the 'Details' command of the current object and return the answer to the variable #STD_BOOL.

Invoke Method(#avFrameworkManager.avCheckUserAuthority) To(COMMAND) Named(DETAILS) ReturnValue(#Std_Bool)