Re: Ponder: ERUser vs User and my authentication delegate

James Cicenia <[email protected]>
Newsgroups gmane.comp.web.webobjects.wonder-disc
Message-ID <[email protected]>
That is what I did..

Then I get:
java.lang.ClassCastException: er.users.model.ERUser cannot be cast to com.pp.eos.User
?



On Dec 18, 2012, at 3:09 PM, Ramsey Gurley <[email protected]> wrote:

> The method signature from ERTwoFactorAuthenticationDelegate is
> 
> public WOComponent successPage()
> 
> You can return any WOComponent you want at this point.  So an example might be
> 
> //pseudo code
> public WOComponent successPage() {
> 	YourUser user = (YourUser) ERStageManager.USER.valueInObject(ERXSession.session().objectStore());
> 	if(user.roles.roleName.contains("admin")) {
> 		return WOApplication.application().pageWithName("AdminDashboard", ERXWOContext.currentContext());
> 	} else {
> 		return D2W.factory().pageForConfigurationNamed("ListPickles", ERXSession.session());
> 	}
> }
> 
> On Dec 18, 2012, at 1:46 PM, James Cicenia wrote:
> 
>> OK -
>> 
>> Back to this.
>> 
>> Since I am trying not to change your framework. How to do I change it to reference my subclass User?
>> I dutifully created a RoleBasedAuthenticationDelegate.
>> 
>> You said I could switch the success page here. The problem is my logic requires my User subclass
>> and you are returning an ERUser class. I can't down cast to User.
>> 
>> How do you get around that?
>> 
>> James Cicenia 
>> cell: 773.398.4649
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>> Remotely access PCs and mobile devices and provide instant support
>> Improve your efficiency, and focus on delivering more value-add services
>> Discover what IT Professionals Know. Rescue delivers
>> http://p.sf.net/sfu/logmein_12329d2d_______________________________________________
>> Wonder-disc mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wonder-disc
>

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d

_______________________________________________
Wonder-disc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wonder-disc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.