It goes without saying that most established IBM i sites have lots of active users. For companies in the process of moving their green screen users into the Valence Portal, setting up appropriately configured Valence profiles for each IBM i user can be an added burden to implementation. Fortunately, with Valence 4.0 it's no longer necessary to pre-configure a Valence profile for every user logging in to the Valence Portal. The default setting for Valence 4.0 installations is to allow any valid IBM i profile to log in to the Valence Portal with the same user and password they use to log into the green screen. The Valence profile for users logging in for the first time is created automatically based on the whatever is specified in the "Default user template (Valence login ID)" in Portal Admin/Settings.
The default value for this setting is VVADMIN, meaning any valid IBM i user logging in to the Valence Portal who does not already have a Valence profile will have one created automatically based on VVADMIN. This profile typically belongs to all groups and has access to all environments and apps, which may not be the desired setting to retain for the average user. Thus it is generally recommended you create a dummy profile (i.e., a Valence user called DUMMY) with minimal authority, then specify this profile as your company's default user template. (Note: you can disable the automatic Valence profile creation feature altogether by blanking out this value, thereby reverting back to the Valence 3.2 standard of requiring a Valence profile be created for every user before they can log in to the portal.)
But what if you wanted different IBM i users to have different Valence authorities based on their job function? If your users' job functions or department can be derived from some database files or logic you already have established on your system, you have another option: You can take advantage of a new exit program feature added in the 4.0.20140519.0 build, in which you can override the template profile depending on who is logging in...
The exit program specified in the new "Session login - user template override" setting is called with two parameters, both defined as 64C (graphic) fields. The first parameter is an input field containing the user ID attempting to log in to the Valence Portal (could be either an IBM i or an LDAP user ID, depending on your setup); the second parameter is an output field containing the Valence profile that should override the "Default user template" setting. See RPG source member EXEXITPGMU for an example of how to set this up.
So if your system has a custom file containing a list of valid IBM i users by, say, department, you could use that info in your exit program to programmatically override the template profile to an appropriate value upon login. For instance, you might have special Valence template profiles called DUMMY_ACCOUNTING, DUMMY_PAYROLL, DUMMY_CUST-SERVICE, etc., which could be used as needed whenever your IBM i users log in to the Portal for the first time. This can greatly reduce the time and effort required to get large number of users set up with the appropriate portal authorities.
You may also want to refine other data in the Valence profile after each user logs in. For instance, you might want to add or update the user's email address or adjust the description for the user. You could achieve this by using the exit program specified in the "Session Login" field, specifying a simple RPG program that, upon each successful login, would chain to the appropriate VVUSERS record and update the VVEMAIL and/or VVDESC fields as needed. Look at RPG source member EXEXITPGM for example code. For more information on exit programs, see the "Exit Programs" section of the Global Settings Guide.