[Bugfix] fixed a bug where if the <AllAllowed> tag was not defined in

the PrivilegeModel.xml file then a NullPointer was thrown. It is now
possible to leave out this tag, in which case false is assumed
This commit is contained in:
Robert von Burg 2011-11-09 15:03:50 +01:00
parent 058e67f10e
commit cb6215b235
1 changed files with 5 additions and 2 deletions

View File

@ -491,8 +491,11 @@ public class XmlPersistenceHandler implements PersistenceHandler {
String privilegeName = privilegeElement.attributeValue(XmlConstants.XML_ATTR_NAME);
String privilegePolicy = privilegeElement.attributeValue(XmlConstants.XML_ATTR_POLICY);
String allAllowedS = privilegeElement.element(XmlConstants.XML_ALL_ALLOWED).getTextTrim();
boolean allAllowed = Boolean.valueOf(allAllowedS).booleanValue();
Element allAllowedE = privilegeElement.element(XmlConstants.XML_ALL_ALLOWED);
boolean allAllowed = false;
if (allAllowedE != null) {
allAllowed = Boolean.valueOf(allAllowedE.getTextTrim()).booleanValue();
}
@SuppressWarnings("unchecked")
List<Element> denyElements = privilegeElement.elements(XmlConstants.XML_DENY);