Results 1 to 5 of 5

Thread: ACL DAOs

  1. #1
    Join Date
    Dec 2004
    Location
    New York
    Posts
    30

    Default ACL DAOs

    Hi:

    I have an application with multiple classes that use ACL-permissioning to control access to individual instances. I would prefer to keep the ACL info for each domain class separate. Does this mean that I should extend the ACL DAO multiple times? For example, packages like:

    businessdomain1.auth.acl.dao
    businessdomain2.auth.acl.dao

    Where in each package there is a class that extends net.sf.acegisecurity.acl.basic.jdbc.JdbcExtendedDa oImpl and overwrites the SQL string to query a different database table that contains ACL permission information?

    Thanks,

    Dave

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Recall that AclProviderManager allows a list of AclProvider instances to be assigned against its setProviders(List) method. So what you do is use this to progressively poll multiple AclProviders until one "supports" your domain object.

    The BasicAclProvider (which implements AclProvider) class provides a setRestrictSupportToClass(Class) method. This default to null, meaning the BasicAclProvider believes its underlaying BasicAclDao knows about every possible domain object instance. So you'd just set restrictSupportToClass to one domain object, and repeat the process for different domain objects.

  3. #3
    Join Date
    Dec 2004
    Location
    New York
    Posts
    30

    Default

    Ben:

    Thanks for the reply. Just to clarify, the default schema has tables for acl_object_identity and acl_permission. Instead of lumping all permissions into these two tables, what I'd like to do is have something like domain_class1_acl_object_identity, domain_class1_acl_permission, domain_class2_acl_object_identity, domain_class2_acl_permission, etc. Doesn't this mean I'll need a different ACL DAO for each secured domain object? Does it seem legitimate to want to keep ACL instance data for each secured domain object in separate tables in the first place?

    Thanks again for your help

    Dave

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    You've got five main options:

    1. Write your own AclManager framework. A lot of work.

    2. Write your own AclProvider implementation. A lot of work, but slightly less than option 1.

    3. Have multiple BasicAclProviders and each BasicAclProvider instance has its own BasicAclDao instance which stores the ACL permissions for just one domain object instance.

    4. Write a more intelligent BasicAclDao, which talks to different tables. You could even have the "switching" between different BasicAclDaos take place at this level.

    5. Put them all into one table. I honestly can't see any problem with this. Modern database can very impressively handle millions of ACL rows on commodity-level hardware. The standard schema imposes negligible constaints on database performance.

  5. #5
    Join Date
    Dec 2004
    Location
    New York
    Posts
    30

    Default

    Ben: Thanks for your input -- this is very helpful!

Similar Threads

  1. Replies: 2
    Last Post: Dec 1st, 2005, 02:51 PM
  2. DAOs with dynamic data source
    By rhasselbaum in forum Data
    Replies: 9
    Last Post: Jan 27th, 2005, 02:37 PM
  3. Replies: 1
    Last Post: Jan 11th, 2005, 12:21 PM
  4. Combining Hibernate and JDBC DAOs
    By rosco in forum Data
    Replies: 8
    Last Post: Jan 4th, 2005, 01:34 PM
  5. Should Business Objects have References to DAOs?
    By sethladd in forum Architecture
    Replies: 9
    Last Post: Aug 25th, 2004, 01:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •