Matthew Langham wrote:
Thanks Matthew! That's some functionality that I didn't know existed. Is there documentation somewhereMy idea was to use an action to do this check, like the auth-protect except that this action would set some parameters indicating which resource the pipeline should use. <<Use the auth-protect action. This action returns a map of values to the sitemap processing. Inside the Action use the parameterSelector. And then test against "{../role}".
that describes this behaviour of the sunRise actions?
Here is an example fragment that does something similar - except it tests the "{../id}". <map:match pattern="sunspotdemo-portlets"> <map:generate type="portal"/> <map:select type="parameter"> <map:parameter name="parameter-selector-test" value="{../ID}"/> <map:when test="guest"> <map:transform src="styles/portalHTML-tab.xsl"> <map:parameter name="use-request-parameters" value="true"/> </map:transform> </map:when> <map:when test="gast"> <map:transform src="styles/portalHTML-tab.xsl"> <map:parameter name="use-request-parameters" value="true"/> </map:transform> </map:when> <map:otherwise> <map:transform src="styles/portalHTML.xsl"> <map:parameter name="use-request-parameters" value="true"/> </map:transform> </map:otherwise> </map:select> << That's it. No programming needed :-) Matthew -- Open Source Group Cocoon { Consulting, Training, Projects } ================================================================= Matthew Langham, S&N AG, Klingenderstrasse 5, D-33100 Paderborn Tel:+49-5251-1581-30 [EMAIL PROTECTED] - http://www.s-und-n.de ----------------------------------------------------------------- Cocoon book: http://www.amazon.com/exec/obidos/ASIN/0735712352/needacake-20 Weblog: http://radio.weblogs.com/0103021/ ================================================================= -----Original Message----- From: Damian Chojna [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 31, 2002 3:44 PM To: [EMAIL PROTECTED] Subject: Re: Authorisation in Cocoon 2.0.3 Matthew Langham wrote:What is stopping you from using the authentication as provided?As far as I've been able to discover, the sunRise solution (in 2.0.3) doesn't supply a mechanism for restricting resources by user role. All that it does is check that the user has successfully logged in. I need a way to control which resources are available to certain users based on their role. My idea was to use an action to do this check, like the auth-protect except that this action would set some parameters indicating which resource the pipeline should use. I'm new to cocoon and the way things are done under it so I'm very open to any and suggestions. DamianOh and if someone knows of a better (and easier) way of doing authorisation in 2.0.3 I'm keen on hearing about it, eventhough I want to try my action method first. << Perhaps you could detail what is missing from the provided solution? Matthew -- Open Source Group Cocoon { Consulting, Training, Projects } ================================================================= Matthew Langham, S&N AG, Klingenderstrasse 5, D-33100 Paderborn Tel:+49-5251-1581-30 [EMAIL PROTECTED] - http://www.s-und-n.de ----------------------------------------------------------------- Cocoon book: http://www.amazon.com/exec/obidos/ASIN/0735712352/needacake-20 Weblog: http://radio.weblogs.com/0103021/ ================================================================= -----Original Message----- From: Damian Chojna [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 31, 2002 3:24 PM To: cocoon-users Subject: Authorisation in Cocoon 2.0.3 Hi All, I'm trying to write my own action to handle user authorisation. I'm using sunRise for user authentication and need a way to get at the <ID> and <role> values for the current session from within an action (a Java class). I know I need a reference to the sunRise context, but don't know how to get it. Once I have that reference, how do I use it? Can someone point me in the right direction? Oh and if someone knows of a better (and easier) way of doing authorisation in 2.0.3 I'm keen on hearing about it, eventhough I want to try my action method first. Thanks in advance, Damian. --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>
--------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>