Magnus Haraldsen Amundsen schrieb:
Using Cocoon 2.2 RC2 and the Cocoon Authentication block.

First the sitemap uses

<map:act type="cauth-is-logged-in">

    <map:parameter name="application" value="Sublima"/>

    […]

</map:act>

<map:redirect-to uri="{request:contextPath}/login"/>

To check if the user is logged in.

The user logs in and we use a Java class that extends AbstractSecurityHandler to do the username/password check and that returns a User object.

We can set additional attributes to this User object using User.setAttribute(key, value) and we want to do this to control which role the user has.

In the other Java code we use the ApplicationManager to see if the user is logged in, by calling ApplicationManager.isLoggedIn(“Sublima”).

How do we get the User object that were created upon login? We can’t find any methods in ApplicationManager that returns User.

Have a look at the ApplicationUtil class. If you have access to the objectModel map (don't know how to get this in 2.2), you can use the static methods. If not, create an instance of the ApplicationUtil class and call getUser().

HTH
Carsten

--
Carsten Ziegeler
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to