Fixed GrantedAuthorityEffectiveAclsResolver if null ACLs provided to method.

This commit is contained in:
Ben Alex 2004-08-23 02:03:46 +00:00
parent eb9c7d0852
commit 3f87849f31
3 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,7 @@ Changes in version 0.x (2004-xx-xx)
* Extracted removeUserFromCache(String) to UserCache interface
* Fixed EH-CACHE-based caching implementation behaviour when cache exists
* Fixed Ant "release" target not including project.properties
* Fixed GrantedAuthorityEffectiveAclsResolver if null ACLs provided to method
* Documentation improvements
Changes in version 0.6 (2004-08-09)

View File

@ -59,6 +59,10 @@ public class GrantedAuthorityEffectiveAclsResolver
public AclEntry[] resolveEffectiveAcls(AclEntry[] allAcls,
Authentication filteredBy) {
if ((allAcls == null) || (allAcls.length == 0)) {
return null;
}
List list = new Vector();
for (int i = 0; i < allAcls.length; i++) {

View File

@ -104,6 +104,11 @@ public class GrantedAuthorityEffectiveAclsResolverTests extends TestCase {
resolver.resolveEffectiveAcls(acls, scott)[2]);
}
public void testResolveAclsReturnsNullIfNoAclsInFirstPlace() {
GrantedAuthorityEffectiveAclsResolver resolver = new GrantedAuthorityEffectiveAclsResolver();
assertNull(resolver.resolveEffectiveAcls(null, scott));
}
public void testSkipsNonBasicAclEntryObjects() {
GrantedAuthorityEffectiveAclsResolver resolver = new GrantedAuthorityEffectiveAclsResolver();
AclEntry[] basicAcls = {entry100Marissa, entry100Scott, entry100RoleEverybody, entry100RoleOne, new MockAcl(), entry100RoleTwo};