From e61097b8881bc7e72a5499816cb1199ea274a3ca Mon Sep 17 00:00:00 2001 From: Sebastien Braun Date: Thu, 7 Oct 2010 22:54:10 +0200 Subject: Rework template meta-magic - No more implicit dependency on Boost.MPL - Better documentation for template magic - Move input handler policies to handler definitions where they belong - Separate out event descriptions from handlers --- src/input/allowLocalOrPrivileged.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/input/allowLocalOrPrivileged.cpp (limited to 'src/input/allowLocalOrPrivileged.cpp') diff --git a/src/input/allowLocalOrPrivileged.cpp b/src/input/allowLocalOrPrivileged.cpp new file mode 100644 index 0000000..ba456dc --- /dev/null +++ b/src/input/allowLocalOrPrivileged.cpp @@ -0,0 +1,21 @@ +/* + * inputHandlerSecurityPolicies.cpp + * + * Created on: Oct 7, 2010 + * Author: brs + */ + +#include "inputEventHandler.h" +#include "pvsCheckPrivileges.h" + +bool input_policy::AllowLocalOrPrivileged::allow(InputEventContext const* ctx) +{ + if(ctx) + { + if(PVSCheckPrivileges::instance()->require(PVSCheckPrivileges::SESSION_LOCAL, ctx)) + return true; + if(PVSCheckPrivileges::instance()->require(PVSCheckPrivileges::USER_PRIVILEGED, ctx)) + return true; + } + return false; +} -- cgit v1.2.3-55-g7522