List of usage examples for org.springframework.security.acls.domain AclImpl isEntriesInheriting
@Override public boolean isEntriesInheriting()
From source file:org.bremersee.common.security.acls.jdbc.BasicLookupStrategy.java
/** * The final phase of converting the <code>Map</code> of <code>AclImpl</code> * instances which contain <code>StubAclParent</code>s into proper, valid * <code>AclImpl</code>s with correct ACL parents. * * @param inputMap the unconverted <code>AclImpl</code>s * @param currentIdentity the current<code>Acl</code> that we wish to convert (this * may be//from w w w . j av a 2 s. c o m * */ private AclImpl convert(Map<Serializable, Acl> inputMap, Long currentIdentity) { Assert.notEmpty(inputMap, "InputMap required"); Assert.notNull(currentIdentity, "CurrentIdentity required"); // Retrieve this Acl from the InputMap Acl uncastAcl = inputMap.get(currentIdentity); Assert.isInstanceOf(AclImpl.class, uncastAcl, "The inputMap contained a non-AclImpl"); AclImpl inputAcl = (AclImpl) uncastAcl; Acl parent = inputAcl.getParentAcl(); if ((parent != null) && parent instanceof StubAclParent) { // Lookup the parent StubAclParent stubAclParent = (StubAclParent) parent; parent = convert(inputMap, stubAclParent.getId()); } // Now we have the parent (if there is one), create the true AclImpl AclImpl result = new AclImpl(inputAcl.getObjectIdentity(), inputAcl.getId(), aclAuthorizationStrategy, grantingStrategy, parent, null, inputAcl.isEntriesInheriting(), inputAcl.getOwner()); // Copy the "aces" from the input to the destination // Obtain the "aces" from the input ACL List<AccessControlEntryImpl> aces = readAces(inputAcl); // Create a list in which to store the "aces" for the "result" AclImpl instance List<AccessControlEntryImpl> acesNew = new ArrayList<>(); // Iterate over the "aces" input and replace each nested // AccessControlEntryImpl.getAcl() with the new "result" AclImpl instance // This ensures StubAclParent instances are removed, as per SEC-951 for (AccessControlEntryImpl ace : aces) { setAclOnAce(ace, result); acesNew.add(ace); } // Finally, now that the "aces" have been converted to have the "result" AclImpl // instance, modify the "result" AclImpl instance setAces(result, acesNew); return result; }