Re: User Roles and Flowscript

2006-03-29 Thread Derek Hohls
As always, the archives are worth searching as well ;-) e.g.

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=113769531804110&w=2

(I had a similar problem)

>>> [EMAIL PROTECTED] 2006/03/29 10:47 PM >>>
Stewart, Gary wrote:
> Hi there,
> 
> I've been working with the authentication resource for a while but I figured 
> it was about time I implemented per role pipelines (that is some pipelines 
> can only be accessed by some roles). I am using flowscript to do this but I 
> don't seem to be able to get it to work. The pipeline performs an 
> authentication check (I figure this would give me the session information; or 
> is there something I need to do in the flow?). In the Javascript I quite 
> simply have:
> 
> function administratorOnlyPage()
> {
>  var resource = cocoon.parameters.resourceRequest;
>  if(cocoon.request.isUserInRole("Administrator"))
>  {
>   cocoon.sendPage(resource);
>  }
>  else
>  {
>   cocoon.sendPage("access-denied");
>  }
> }
> 
> I've checked the user role on another page and it appears that they are an 
> administrator. Is there something I'm missing? Do I need to define the roles?
> 
> Sorry to bother and thanks,
> 
> Gary
> 
> *
> The information contained in this message may be confidential or 
> legally privileged and is intended for the addressee only. If you 
> have received this message in error or there are any problems 
> please notify the originator immediately. The unauthorised use, 
> disclosure, copying or alteration of this message is 
> strictly forbidden.
> *
> 
> 
> If you work for NHS Lothian and wish to have help to stop smoking, support is 
> available by contacting [EMAIL PROTECTED] or 0131 537 9494  - internal 49494. 
>  For anyone else living/working in Lothian, please contact 0800 848484 for 
> your nearest NHS stop smoking service.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 
> 

Hi Gary,

this might help you:
http://wiki.apache.org/cocoon/AuthFWWithFlow 

It didn't help me. I have the same problem like in 
http://www.planetcocoon.com/node/1879 

However, you can use something like this:



when you call your javaflow function, and

var uid = cocoon.parameters["userid"];

in your javaflow.

Regards,
Wadim






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



-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
[EMAIL PROTECTED]


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


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



Re: User Roles and Flowscript

2006-03-29 Thread Wadim Kruse

Stewart, Gary wrote:

Hi there,

I've been working with the authentication resource for a while but I figured it 
was about time I implemented per role pipelines (that is some pipelines can 
only be accessed by some roles). I am using flowscript to do this but I don't 
seem to be able to get it to work. The pipeline performs an authentication 
check (I figure this would give me the session information; or is there 
something I need to do in the flow?). In the Javascript I quite simply have:

function administratorOnlyPage()
{
 var resource = cocoon.parameters.resourceRequest;
 if(cocoon.request.isUserInRole("Administrator"))
 {
  cocoon.sendPage(resource);
 }
 else
 {
  cocoon.sendPage("access-denied");
 }
}

I've checked the user role on another page and it appears that they are an 
administrator. Is there something I'm missing? Do I need to define the roles?

Sorry to bother and thanks,

Gary

*
The information contained in this message may be confidential or 
legally privileged and is intended for the addressee only. If you 
have received this message in error or there are any problems 
please notify the originator immediately. The unauthorised use, 
disclosure, copying or alteration of this message is 
strictly forbidden.

*


If you work for NHS Lothian and wish to have help to stop smoking, support is 
available by contacting [EMAIL PROTECTED] or 0131 537 9494  - internal 49494.  
For anyone else living/working in Lothian, please contact 0800 848484 for your 
nearest NHS stop smoking service.


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




Hi Gary,

this might help you:
http://wiki.apache.org/cocoon/AuthFWWithFlow

It didn't help me. I have the same problem like in 
http://www.planetcocoon.com/node/1879


However, you can use something like this:

value="{session-context:authentication/authentication/ID}" />


when you call your javaflow function, and

var uid = cocoon.parameters["userid"];

in your javaflow.

Regards,
Wadim






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



User Roles and Flowscript

2006-03-29 Thread Stewart, Gary
Hi there,

I've been working with the authentication resource for a while but I figured it 
was about time I implemented per role pipelines (that is some pipelines can 
only be accessed by some roles). I am using flowscript to do this but I don't 
seem to be able to get it to work. The pipeline performs an authentication 
check (I figure this would give me the session information; or is there 
something I need to do in the flow?). In the Javascript I quite simply have:

function administratorOnlyPage()
{
 var resource = cocoon.parameters.resourceRequest;
 if(cocoon.request.isUserInRole("Administrator"))
 {
  cocoon.sendPage(resource);
 }
 else
 {
  cocoon.sendPage("access-denied");
 }
}

I've checked the user role on another page and it appears that they are an 
administrator. Is there something I'm missing? Do I need to define the roles?

Sorry to bother and thanks,

Gary

*
The information contained in this message may be confidential or 
legally privileged and is intended for the addressee only. If you 
have received this message in error or there are any problems 
please notify the originator immediately. The unauthorised use, 
disclosure, copying or alteration of this message is 
strictly forbidden.
*


If you work for NHS Lothian and wish to have help to stop smoking, support is 
available by contacting [EMAIL PROTECTED] or 0131 537 9494  - internal 49494.  
For anyone else living/working in Lothian, please contact 0800 848484 for your 
nearest NHS stop smoking service.


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