Hi!
Ju must catch the exception that is thrown by getRoles():

try {
  Iterator roles =
 
JetspeedRoleManagement.getRoles(rundata.getJetspeedUser().getUserName())
;
}
catch (JetspeedSecurityException ex) {
         ...  //do something with ex
}

Greetings
Lukasz Olek

> -----Original Message-----
> From: Shorney, Rob [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 30, 2002 9:13 AM
> To: 'Jetspeed Users List'
> Subject: RE: Security - User Roles
> 
> Hi,
> 
> Many thanks for this, however when I put this code in and compile I
get
> the
> following error.
> 
> I have put the code in the getContent() method
> 
> "UserDetails.java": Error #: 360 : unreported exception:
> org.apache.jetspeed.services.security.JetspeedSecurityException; must
be
> caught or declared to be thrown at line 35, column 45
> 
> 
> Regards
> 
> Rob Shorney
> PDS - Local Government - Front Office Development Team
> Northgate Information Solutions
>
------------------------------------------------------------------------
--
> --
> --------
> 
> 
> -----Original Message-----
> From: Maciej Dziergwa [mailto:[EMAIL PROTECTED]]
> Sent: 29 October 2002 21:30
> To: Jetspeed Users List
> Subject: Re: Security - User Roles
> 
> 
> Hi,
> 
> Try this:
> 
> Iterator roles =
>
JetspeedRoleManagement.getRoles(rundata.getJetspeedUser().getUserName())
;
> 
> MaciekD
> 
> 
> 
> > Hi,
> >
> > Please could someone supply some sample code on how to retrieve what
> roles
> a
> > user belongs to.
> >
> > I need to be able to determine this in either the init () or the
> > getContent() methods as this will determine what html page to
display in
> the
> > portlet.
> >
> > Many thanks in advance.
> >
> >
> > Regards
> >
> > Rob Shorney
> > PDS - Local Government - Front Office Development Team
> > Northgate Information Solutions
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> This email is sent on behalf of Northgate Information Solutions UK
Limited
> ("Northgate") and is strictly confidential and intended solely for the
> addressee(s).  It may contain personal and confidential information
and as
> such may be protected by the Data Protection Act 1998.
> 
> If you are not the intended recipient of this email you must: (i) not
> disclose, copy or distribute its contents to any other person nor use
its
> contents in any way or you may be acting unlawfully;  (ii) contact
> Northgate immediately on +44 (0)1442 232424 quoting the name of the
sender
> and the addressee then delete it from your system.
> 
> Any views or opinions expressed within this email are those of the
author,
> and do not necessarily represent those of Northgate.
> 
> Northgate has scanned this email for viruses but does not accept any
> responsibility once this email has been transmitted.  You should scan
> attachments (if any) for viruses.
> 
> --
> To unsubscribe, e-mail:   <mailto:jetspeed-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:jetspeed-user-
> [EMAIL PROTECTED]>


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

Reply via email to