uniform XML boolean attribute access

Replace 'attribute(...).has_value("yes")`
with 'attribute_value(..., false)'.

This allows for boolean configuration to be set with values such as
"true", "false", "yes", "no", or "1", "0".

Fixes #2002
This commit is contained in:
Emery Hemingway
2016-06-09 15:55:13 +02:00
committed by Christian Helmuth
parent 51e8f05fb6
commit 8ae2f65da8
35 changed files with 72 additions and 173 deletions

View File

@@ -410,9 +410,7 @@ class File_system::Root : public Root_component<Session_component>
/*
* Determine if write access is permitted for the session.
*/
try {
writeable = policy.attribute("writeable").has_value("yes");
} catch (Xml_node::Nonexistent_attribute) { }
writeable = policy.attribute_value("writeable", false);
} catch (Session_policy::No_policy_defined) {
PERR("Invalid session request, no matching policy");