Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Excerpt

A collection of simple security-related tags using Atlassian's Seraph and the Berkano Seraph add-on.

Usage examples

Some simple example will quickly show you what these tags can do:

Role based tag : <s:auth>

Code Block
xml
xml
<s:auth requiredRole="admin">this text will only appear if the logged user has the 'admin' role</s:auth>

Path based tags : <s:spath> and <s:slink>

Code Block
xml
xml
<s:spath href="/foo">this text will only appear is user has access to the /foo path</s:spath>
Code Block
xml
xml
<s:slink href="/foo/bar.action">hey you</s:slink>

This outputs <a href="/context-path/foo/bar.action">hey you</a> if the user has access to path /foo/bar.action, otherwise outputs nothing.

Code Block
xml
xml
<s:slink href="/foo/bar.action" alwaysOutputBody="true">hey you</s:slink>

This outputs <a href="/context-path/foo/bar.action">hey you</a> if the user has access to path /foo/bar.action, otherwise outputs hey you without the surrounding <a/>.

(warning) Path based tags require that you pass paths as they are configured in your Seraph setup, i.e. relative to the context path of your webapp, starting with a /. For the slink tag, if you specify a path starting with a /, the context path of your webapp will be prepended the href output, except if you specified a value of false for the includeContext attribute. (to be clarified)