LinkedList<Value> list = new LinkedList<Value>();
LOGGER.log(Level.FINEST, "Find ACL property: {0}", name);
if (SpiConstants.PROPNAME_DOCUMENTTYPE.equals(name)) {
list.add(Value.getStringValue(SpiConstants.DocumentType.ACL.toString()));
return new SimpleProperty(list);
} else if (SpiConstants.PROPNAME_ACTION.equals(name)) {
list.add(Value.getStringValue(ActionType.ADD.toString()));
return new SimpleProperty(list);
} else if (SpiConstants.PROPNAME_DOCID.equals(name)) {
list.add(Value.getStringValue(docId));
return new SimpleProperty(list);
} else if (SpiConstants.PROPNAME_ACLINHERITFROM_DOCID.equals(name)) {
if (parentId == null) {
return null;
} else {
list.add(Value.getStringValue(parentId));
return new SimpleProperty(list);
}
} else if (SpiConstants.PROPNAME_ACLINHERITANCETYPE.equals(name)) {
list.add(Value.getStringValue(inheritanceType.toString()));
return new SimpleProperty(list);
} else if (SpiConstants.PROPNAME_ACLUSERS.equals(name)) {
if (allowUsers.isEmpty()) {
return null;
} else {
FileUtil.addPrincipals(list, PrincipalType.UNKNOWN,
googleGlobalNamespace, allowUsers,
CaseSensitivityType.EVERYTHING_CASE_INSENSITIVE);
return new SimpleProperty(list);
}
} else if (SpiConstants.PROPNAME_ACLDENYUSERS.equals(name)) {
if (denyUsers.isEmpty()) {
return null;
} else {
FileUtil.addPrincipals(list, PrincipalType.UNKNOWN,
googleGlobalNamespace, denyUsers,
CaseSensitivityType.EVERYTHING_CASE_INSENSITIVE);
return new SimpleProperty(list);
}
} else if (SpiConstants.PROPNAME_ACLGROUPS.equals(name)) {
if (allowGroups.isEmpty()) {
return null;
} else {
FileUtil.addPrincipals(list, PrincipalType.UNKNOWN,
googleGlobalNamespace, allowGroups,
CaseSensitivityType.EVERYTHING_CASE_INSENSITIVE);
return new SimpleProperty(list);
}
} else if (SpiConstants.PROPNAME_ACLDENYGROUPS.equals(name)) {
if (denyGroups.isEmpty()) {
return null;
} else {
FileUtil.addPrincipals(list, PrincipalType.UNKNOWN,
googleGlobalNamespace, denyGroups,
CaseSensitivityType.EVERYTHING_CASE_INSENSITIVE);
return new SimpleProperty(list);
}
} else {
return null;
}
}