Re: Ponder: ERUser vs User and my authentication delegate
Ramsey Gurley <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <[email protected]> |
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