ClassName |
|
---|---|
Component |
|
The HasEffectivePrincipal
servlet bean checks whether a user has a specified identity and renders content based on the result of its query. For example, you can check if the user has a specific principal (identity), if the user is a member of a specified organization, or if the user has a specified role, and you can set this servlet bean to render that information.
Input Parameters
type
You must set this required parameter to one of the following four values:
user
organization
role
relative
role
profile
group
id
This input parameter represents the identity you want to look up. The value you specify depends on the value of the type
parameter:
user
: the login name of the user. Example:MGarcia
organization
: the path and organization name. Three examples:AnyCorps, /AnyCorps,
and/AnyCorps/someOrganization
role
: the path and a global role name. Three examples:admin
,/admin
, and/admin/networkAdmin
.relative
role
: the organization name and functional role name separated by a backslash (/). Example:Accounting/VicePresident
.
The best way to find a path for an organization or a global role is to look in the ACC People and Organizations task area. For example, you can find all global roles in the People and Organizations task area, under the Roles option. By expanding the Global Roles tree option, you can navigate to each role by traversing its path.
Notice that id
values can have a leading slash, but one is not required.
Open Parameters
output
This parameter is rendered if the identity check is successful.
default
This parameter is rendered if the identity check fails.
unknown
This parameter is rendered if the user has no known identity.
Example:
Use the HasEffectivePrincipal
servlet bean to determine whether the current user is assigned the role of Administrator.
<dsp:droplet name="/atg/dynamo/droplet/HasEffectivePrincipal"> <dsp:param name="type" value="role"/> <dsp:param name="id" value="Administrator"/> <dsp:oparam name="output"> You are an administrator<p> </dsp:oparam> <dsp:oparam name="default"> You are not an administrator<p> </dsp:oparam> <dsp:oparam name="unknown"> You are not logged in<p> </dsp:oparam> </dsp:droplet>