You can create an instance of org.apache.shiro.subject.SimplePrincipalCollection.
Add to it the principal you need to impersonate. On Fri, Sep 23, 2011 at 9:25 PM, Sudhir N <[email protected]> wrote: > Okey, Thanks for the response, > Manoj, How do I obtain PrincipalCollection ? > > > Sudhir > > ________________________________ > From: Luke Biddell <[email protected]> > To: [email protected] > Cc: Sudhir N <[email protected]> > Sent: Saturday, 24 September 2011 4:14 AM > Subject: Re: Impersonate an user > > We took a slightly different approach in the past with this problem. > We had a stateful Seam application and so had two managed beans. One > representing your identity and the other a user. > For regular users these would effectively be the same. For administrators, > they had the necessary permission to search and choose the user object. > In all our Seam EL we then referenced #{currentuser.name} etc and it all > worked rather nicely. > > On 23 September 2011 23:25, Manoj Khangaonkar <[email protected]> wrote: > > HI > > Use the method > > Subject.runAs(PrincipalCollection .... > > to impersonate a user and the method > > Subject.releaseRunAs > > to revert back to the original > > Manoj > > > > On Thu, Sep 22, 2011 at 11:45 PM, Sudhir N <[email protected]> wrote: >> >> I need to implement the 'Impersonate an user' functionality so that who >> ever >> has that perm. can see the application from users perspective. >> Can any one guide me on how that can be accomplished. >> I am using Shiro with grails (Shiro security plugin), but that does not >> change the things much I believe. >> >> Thanks >> Sudhir >> http://www.geeksays.com > > > > -- > http://khangaonkar.blogspot.com/ > > > > -- http://khangaonkar.blogspot.com/
