Hi William

I came up with a different solution that involved taking the following code:

           AccessControlList acl = data.getACL();
            if ( acl == null )
            {
                acl = TurbineSecurity.getACL( data.getUser() );
                data.getSession().setAttribute( 
AccessControlList.SESSION_KEY,
                                            (Object)acl );
            }
            data.setACL(acl);
            data.save();   
       
           if (acl!=null && acl.hasRole("turbine_root"))
           {
              data.setScreenTemplate("Index.vm");
           }
           else
           {
              data.setScreenTemplate("Welcome.vm");
           }

and placing it in a copy of LoginUser.java, which I then placed in my 
application as AppLoginUser extends Action.  I have the first login page 
call AppLoginUser instead of LoginUser, and now I have control over 
which screen is displayed to which user.

I also placed this in Default.vm

      #if($data.getACL().hasRole("turbine_root"))
        $navigation.setTemplate("/Menu.vm")
      #elseif($data.getACL().hasRole("content_manager"))
        $navigation.setTemplate("/ContentManagerMenu.vm")
      #end

which allows me to show different menus to different users.

It's probably all the wrong way to go, but it seems to work so far :-)

CHEERS> SAM


William Lee wrote:

> Sam Joseph wrote:
>
>> Hi there,
>>
>> So I'm beginning to get the hang of the TDK security setup, but I 
>> can't quite qork out how to show a different screen/template to a 
>> user when they first log in.
>
>
> I'm not sure it's absolutely the right way to do it.  The problem is 
> that you don't have the ACL unless you get into the the 
> AccessController and after you log in.  I overrided the 
> AccessController and have a variable in the session saying whether the 
> user has logged on for the first time.  If so, my AccessController 
> will determine the first page based on the ACL of the user.
>
> There may be other solutions, but it works for me for now.
>




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

Reply via email to