Hi,

Here's how I would do it:

In your com.mycompany.myproject.modules.screens have 3 abstract classes:

GroupAScreen
GroupBScreen
AdminScreen

You'd have something like this in each:

public abstract class GroupAScreen extends VelocitySecureScreen {
  public void doBuildTemplate(RunData data, Context context) {};
  protected boolean isAuthorized(RunData data) throws Exception {
    boolean isAuthorized = true;
    if (data.getACL() == null ||
          !data.getACL().hasPermission("Group A") &&
          !data.getACL().hasPermission("Admin")) {
      isAuthorized = false;
      //redirect them to the login screen
      String loginTemplate =
Turbine.getConfiguration().getString(TurbineConstants.TEMPLATE_LOGIN);
      data.setScreenTemplate(loginTemplate);
    }
    return isAuthorized;
  }
}

Then have your screen class inherit off of one of the above Screen classes
like so:

public class SecuredIndex extends GroupAScreen {
}

For screen classes that don't require a login, you can either not have a
screen class or inherit off VelocityScreen:

public class RegularIndex extends VelocityScreen {
}

That should do it.

Good luck,

David

-----Original Message-----
From: turbine_newbie [mailto:[EMAIL PROTECTED] 
Sent: Tuesday October 12, 2004 8:37 PM
To: Turbine Users List
Subject: ACL newbie


hi to all! im a newbie in using turbine. can you
please guide me through making an ACL... here's what
im planning to do... 
1.  I will have pages that won't require login
2.  I will have pages that will require login
      a.  a user can't access that page if he doesn't
have sufficient permissions.
      
3.  Suppose i have three groups:
      a. Group A
      b. Group B
      c. Admin Group

Group A can't access the pages belonging to Group B,
Admin Group.  Group B can't access the pages belonging
to Group A, Admin Group.  Admin Group can access all
the pages.
How do i implement this?

Thank you so much for your time and attention. =)



                
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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


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

Reply via email to