I ran into a interesting problem when setting up AclVoters for our project.

We are using our own custom AclEntry that subclasses
AbstractBasicAclEntry.  So when I tried to set up a class that uses
AclVoter, I got a ClassCastException at this particular section:

for(int i = 0; i < entries.length; i++) {
    SimpleAclEntry sae = (SimpleAclEntry)entries[i];
    for(int j = 0; j < requirePermission.length; j++) {
           if(sae.isPermitted(requirePermission[j])) {
                   result = ACCESS_GRANTED;
           }
      }
}

So, from this, it seems that we are casting to SimpleAclEntry because
we need to access the method .isPermitted().  But this method is
defined in AbstractBasicAclEntry.  However because it is abstract, we
cannot cast to that specifically...

So my subclass doesn't work, even though it has the method necessary
to work properly.

I think this can be improved...  it just seems rather odd for
BasicAclEntry to not declare the method, but the abstract
implementation does, and then SimpleAclEntry makes use of it?  This
doesn't lend well to making AclVoter very extensible.

I think could either add the methods to BasicAclEntry, or make another
interface to back the added functions that AbstractBasicAclEntry
brings to the table and update AclVoter accordingly.

Thanks!

-tim


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Home: http://acegisecurity.sourceforge.net
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer

Reply via email to