Tutorial 4 comes with one portlet, the Security Example portlet.
This portlet allows for you to click on four different portal links. These links were created with the $jslink tool, which is used in templates to generate links to portal resources.
Link Name | Linked Resource | Works with Anon | Works with Authenticated |
---|---|---|---|
Page Requires Admin Role |
$jslink.setUser('admin') link to default admin user page | NO | NO |
Page Requires User Role |
$jslink.setGroup('apache','news') link to apache group, news page | NO | YES |
Page Requires No Role |
$jslink.setGroup('apache') link to default apache group page | YES | YES |
Pane Requires User Role |
$jslink.getLink($jslink.USER,'anon','default', $jslink.PANE_ID,'105') link to anonymous user default page, pane id = 105 | NO | YES |
When you test it out, you will see that there is a fifth pane on the anonymous page, but you cannot see it when you are logged on as the anonymous user. However, when you logon as the Turbine user, and click on the "Pane Requires User Role", then the pane does show up, since the Turbine user does have the User role.
The pane in the anonymous page has a security constraint:
<portlets id="105"> <security-ref parent="user-only"/> <metainfo> <title>Secured</title> </metainfo> <entry parent="HelloVelocity"/> </portlets>