[seam-commits] Seam SVN: r9022 - trunk/doc/Seam_Reference_Guide/en-US.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Sep 18 17:26:11 EDT 2008
Author: shane.bryzak at jboss.com
Date: 2008-09-18 17:26:10 -0400 (Thu, 18 Sep 2008)
New Revision: 9022
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Security.xml
Log:
fix RunAsOperation example
Modified: trunk/doc/Seam_Reference_Guide/en-US/Security.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Security.xml 2008-09-18 18:43:25 UTC (rev 9021)
+++ trunk/doc/Seam_Reference_Guide/en-US/Security.xml 2008-09-18 21:26:10 UTC (rev 9022)
@@ -4918,21 +4918,17 @@
<para>
The following code example demonstrates how <literal>RunAsOperation</literal> is used, by
- overriding its <literal>getRoles()</literal> method to specify a set of roles to masquerade
+ calling its <literal>addRole()</literal> method to provide a set of roles to masquerade
as for the duration of the operation. The <literal>execute()</literal> method contains the
code that will be executed with the elevated privileges.
</para>
- <programlisting role="JAVA"><![CDATA[ new RunAsOperation() {
- @Override
- public String[] getRoles() {
- return new String[] { "admin" };
- }
-
+ <programlisting role="JAVA"><![CDATA[ new RunAsOperation() {
public void execute() {
executePrivilegedOperation();
}
- }.run();]]></programlisting>
+ }.addRole("admin")
+ .run();]]></programlisting>
<para>
In a similar way, the <literal>getPrincipal()</literal> or <literal>getSubject()</literal>
More information about the seam-commits
mailing list