SEC-530: Refactor ACL module so ACE manipulation is index-based as

opposed to AccessControlEntry.getId() based.
This commit is contained in:
Ben Alex
2008-04-05 20:43:10 +00:00
parent 431253188d
commit 677607bcad
12 changed files with 107 additions and 147 deletions

View File

@@ -76,9 +76,9 @@ public class SecureDataSourcePopulator extends DataSourcePopulator {
// Now we have an ACL, add another ACE to it
if (level == LEVEL_NEGATE_READ) {
acl.insertAce(null, permission, sid, false); // not granting
acl.insertAce(acl.getEntries().length, permission, sid, false); // not granting
} else {
acl.insertAce(null, permission, sid, true); // granting
acl.insertAce(acl.getEntries().length, permission, sid, true); // granting
}
// Finally, persist the modified ACL

View File

@@ -54,7 +54,7 @@ public class SecureDocumentDaoImpl extends DocumentDaoImpl implements SecureDocu
MutableAcl aclParent = (MutableAcl) mutableAclService.readAclById(parentIdentity);
acl.setParent(aclParent);
}
acl.insertAce(null, BasePermission.ADMINISTRATION, new PrincipalSid(SecurityContextHolder.getContext().getAuthentication()), true);
acl.insertAce(acl.getEntries().length, BasePermission.ADMINISTRATION, new PrincipalSid(SecurityContextHolder.getContext().getAuthentication()), true);
mutableAclService.updateAcl(acl);
}