chromium/components/enterprise/data_controls/core/browser/rule.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_ENTERPRISE_DATA_CONTROLS_CORE_BROWSER_RULE_H_
#define COMPONENTS_ENTERPRISE_DATA_CONTROLS_CORE_BROWSER_RULE_H_

#include <optional>
#include <string>
#include <string_view>

#include "base/values.h"
#include "components/enterprise/data_controls/core/browser/action_context.h"
#include "components/enterprise/data_controls/core/browser/conditions/condition.h"
#include "components/policy/core/common/schema.h"

namespace policy {
class PolicyErrorMap;
}  // namespace policy

namespace data_controls {

// Constants used to parse sub-dictionaries of DLP policies that should map to
// an AttributesCondition.
inline constexpr char kRestrictionClipboard[] =;
inline constexpr char kRestrictionScreenshot[] =;
inline constexpr char kRestrictionPrinting[] =;
inline constexpr char kRestrictionPrivacyScreen[] =;
inline constexpr char kRestrictionScreenShare[] =;
inline constexpr char kRestrictionFiles[] =;

inline constexpr char kLevelAllow[] =;
inline constexpr char kLevelBlock[] =;
inline constexpr char kLevelWarn[] =;
inline constexpr char kLevelReport[] =;

// Implementation of a Data Controls policy rule, which provides interfaces to
// evaluate its conditions to obtain verdicts and access other rule attributes.
// This class is a representation of the following JSON:
// {
//   name: string,
//   rule_id: string,
//   description: string,
//
//   sources: { See schema in attributes_condition.h }
//   destinations: { See schema in attributes_condition.h }
//
//   restrictions: [
//     {
//       class: CLIPBOARD|SCREENSHOT|PRINTING|PRIVACY_SCREEN|etc,
//       level: ALLOW|BLOCK|REPORT|WARN
//     }
//   ]
// }
class Rule {};

}  // namespace data_controls

#endif  // COMPONENTS_ENTERPRISE_DATA_CONTROLS_CORE_BROWSER_RULE_H_