ClassName

atg.userdirectory.droplet.HasFunction

Component

/atg/userdirectory/droplet/HasFunction

The HasFunction servlet bean determines whether a given user has a certain functional role and renders certain content based on the result. You can limit the query further by specifying an organization, meaning that a result of true is returned only if the user has the specified role in a particular organization.

Be sure to set the userDirectory property to relevant the User Directory component.

Input Parameters

function
This required parameter indicates the function property of the relative role held by the user.

organizationId
This optional parameter supplies an organization name so the servlet bean returns true only if the user is assigned the function in the organization specified here.

userId
This required parameter holds the ID for the user whose functional role you are checking. For example:

<dsp:param name="userid" beanvalue="/atg/userprofiling/Profile.id"/>
Open Parameters

true
This parameter and the tags nested within it are rendered when an item matches the conditions defined by the input parameters.

false
This parameter and the tags nested within it are rendered when no item matches the conditions defined by the input parameters.

error
This optional parameter is rendered if there is an error when the query executes.

Example

In this example, the HasFunction servlet bean determines if the active user is an admin for the org1001 organization, and when he/she is, displays a link to a page for creating user accounts. Otherwise, a link to the profile page displays.

<dsp:droplet name="/atg/userdirectory/droplet/HasFunction">
   <dsp:param name="function" value="admin"/>
   <dsp:param name="userId" beanvalue="/atg/userprofiling/Profile.id"/>
   <dsp:param name="organizationId"  value="org1001"/>

   <dsp:oparam name="true">
      <dsp:a href="UserAccountForms.jsp">Set up new user accounts</dsp:a>
   </dsp:oparam>

   <dsp:oparam name="false">
      <dsp:a href="UserAccountInfo.jsp">Edit your profile</dsp:a>
   </dsp:oparam>
</dsp:droplet>
 
loading table of contents...