Obtains a user’s roles or organizations.
Class Name |
|
---|---|
Component |
|
Required Input Parameters
userId
The user whose principals are returned.
Optional Input Parameters
principalType
The type of principals to return. Options include organization
and role
. When this parameter is omitted, the default, organization
, is used.
Output Parameters
principals
A java.util.Collection
object that holds the organizations returned from the query.
Open Parameters
empty
Rendered when no items are returned from the query.
error
Rendered when an invalid user ID or no user ID is provided.
output
Rendered when items are returned from the query.
Usage Notes
ViewPrincipalsDroplet lets you locate a user’s roles or organizations. Based on the search results, additional content is rendered by the open parameters you specify.
Be sure to set the userDirectory
property to the relevant User Directory component.
Example
In this example, ViewPrincipals locates all organizations of the current user and displays them.
<dsp:droplet name="/atg/userdirectory/droplet/ViewPrincipals"> <dsp:param name="userId" bean="Profile.id"/> <dsp:param name="principalType" value="organization"/> <dsp:oparam name="output"> <dsp:droplet name="/atg/dynamo/droplet/ForEach"> <dsp:param name="array" param="principals"/> <dsp:oparam name="output"> You are part of the following organizations: <dsp:valueof param="element.name"/> </dsp:oparam> </dsp:droplet> </dsp:oparam> </dsp:droplet>