blob: a40eff5dcc5b4629244e978cfcf1909bb78b9c50 [file] [log] [blame]
// Copyright 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PERMISSION_BROKER_ALLOW_HIDRAW_DEVICE_RULE_H_
#define PERMISSION_BROKER_ALLOW_HIDRAW_DEVICE_RULE_H_
#include "permission_broker/hidraw_subsystem_udev_rule.h"
namespace permission_broker {
// AllowHidrawDeviceRule encapsulates the policy that hidraw devices are allowed
// to be accessed. Any path passed to it that is owned by a device on the hidraw
// subsystem is |ALLOW|ed. All other paths are ignored.
class AllowHidrawDeviceRule : public HidrawSubsystemUdevRule {
public:
AllowHidrawDeviceRule();
AllowHidrawDeviceRule(const AllowHidrawDeviceRule&) = delete;
AllowHidrawDeviceRule& operator=(const AllowHidrawDeviceRule&) = delete;
~AllowHidrawDeviceRule() override = default;
Result ProcessHidrawDevice(struct udev_device* device) override;
};
} // namespace permission_broker
#endif // PERMISSION_BROKER_ALLOW_HIDRAW_DEVICE_RULE_H_