NoDocTitle

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Accessing User Roles Using Oracle WebCenter Ensemble Adaptive Tags

The role* tags in the Oracle WebCenter Ensemble tag library allow pagelets to modify content based on the role of the current user.

For details on roles, see About Oracle WebCenter Ensemble Security.
The pt:ensemble.roleexpr tag evaluates a role expression and stores the result as a boolean in memory. This tag is designed to work with the pt:logic.if tag as shown below.
<pt:ensemble.roleexpr pt:expr="hasRole Default Role from Seed State" pt:key="boolvalue"/>
<pt:logic.if pt:expr="$boolvalue">
<pt:logic.iftrue>
  <!-- This is displayed if expr evaluates to true. -->
</pt:logic.iftrue>
<pt:logic.iffalse>
  <!-- This is displayed if expr evaluates to false. -->
</pt:logic.iffalse>
</pt:logic.if>
The pt:ensemble.rolelist tag stores a list of the roles for the current user in memory. The data is stored as a collection, and each item in the collection is a variable containing the role name. This can be used with the logic.foreach tag to iterate over role data as shown below.
<pt:ensemble.rolelist pt:key="roles"/>
<pt:logic.foreach pt:data="roles" pt:var="role">
<pt:logic.value pt:value="$role"/>
<pt:logic.separator></pt:logic.separator>
</pt:logic.foreach>
For details on logic tags, see Logic Adaptive Tag Library (pt:logic).

  Back to Top      Previous Next