Re: Ponder: ERUser vs User and my authentication delegate
René Bock <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <[email protected]> |
Perhaps, partial entities may be an option as you only extend the existing user entity
Liebe Grüße
René Bock
Am 18.12.2012 um 23:11 schrieb Ramsey Gurley <[email protected]>:
> Oh, I see what you mean.
>
> If you use a custom subclass, you need to use a different page config when creating the user. CreateUser instead of CreateERUser. You'll need to customize with your own nav menu if you haven't already. You'll probably need to duplicate and customize the rules related to the CreateERUser page config too. Since all the delegates operate on the superclass, they should still work, but you may need to subclass those in your own framework if you have additional logic that needs to be handled when your user class is created.
>
> It's designed to be really flexible, but if you need your own User subclass, then you have to roll up your sleeves and get your hands a little dirty.
>
> Ramsey
>
>
> On Dec 18, 2012, at 2:41 PM, James Cicenia wrote:
>
>> 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
------------------------------------------------------------------------------
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