public ACL createACL(Resource resource) { if (resource == null) throw new IllegalArgumentException("ACLs cannot be created for null resources"); ACL acl = this.aclMap.get(resource); if (acl == null) { acl = new ACLImpl(resource); this.aclMap.put(resource, acl); } return acl; }
/** * <p> * Creates and returns the {@code ACL} objects that correspond to the {@code acl-definition}s specified in the XML * configuration file. * </p> * * @return a {@code Set<ACL>} containing the generated {@code ACL}s. */ public Set<ACL> getConfiguredACLs() { Set<ACL> configuredACLs = new HashSet<ACL>(); for (ACLDefinition definition : this.definitions.values()) { Set<ACLEntry> entries = this.getEntries(definition, new ArrayList<String>()); ACLImpl acl = new ACLImpl(definition.getResource(), entries); configuredACLs.add(acl); } return configuredACLs; }
acl = new ACLImpl(resource, entries); entityManager.persist(acl);
acl = new ACLImpl(resource, entries); entityManager.persist(acl);