In August 2006 I wrote a blog about a method for performing role assignment in the SAP NetWeaver Portal based upon certain user characteristics. The example I used was the case where a user got a different role depending on the portal language they chose.
In the portal forums this often led to questions about how the same logic could be adopted to handle a situation where a user had to agree to certain conditions before they were assigned a role.
The following code can do just that.
It is assumed that a user is initially assigned a role which has a single iView. That iView is based on the following portal component. When the user navugates to this iView, they are presented with a number of statemenst that they must agree to before the “OK to continue” style button is activated.
Once the button is selected, a second “real” role is assigned, and the first role deassigned from the user. The portal application is restarted, causing the user to see the new “real” role’s contents.
This example has three conditions of a frivolous nature. The number of conditions is delared as a static int and the conditions themselves are held in a String array.
The result might look like this:
The button will only become enabled when all the checkboxes have been checked on.